Commit 77c168a8 authored by Tom Lane's avatar Tom Lane

Remove grammar productions for prefix and postfix % and ^ operators,

as well as the existing pg_catalog entries for prefix and postfix %.
These have never been documented, though they did appear in one old
regression test.  This avoids surprising behavior in cases like
"SELECT -25 % -10".  Per recent discussion.
Note: although there is a catalog change here, I did not force initdb
since there's no harm in leaving the inaccessible entries in one's
copy of pg_operator.
parent f5b2f60b
<!-- <!--
$PostgreSQL: pgsql/doc/src/sgml/ref/comment.sgml,v 1.28 2005/05/26 20:05:03 tgl Exp $ $PostgreSQL: pgsql/doc/src/sgml/ref/comment.sgml,v 1.29 2005/06/08 21:15:27 tgl Exp $
PostgreSQL documentation PostgreSQL documentation
--> -->
...@@ -243,7 +243,7 @@ COMMENT ON INDEX my_index IS 'Enforces uniqueness on employee ID'; ...@@ -243,7 +243,7 @@ COMMENT ON INDEX my_index IS 'Enforces uniqueness on employee ID';
COMMENT ON LANGUAGE plpython IS 'Python support for stored procedures'; COMMENT ON LANGUAGE plpython IS 'Python support for stored procedures';
COMMENT ON LARGE OBJECT 346344 IS 'Planning document'; COMMENT ON LARGE OBJECT 346344 IS 'Planning document';
COMMENT ON OPERATOR ^ (text, text) IS 'Performs intersection of two texts'; COMMENT ON OPERATOR ^ (text, text) IS 'Performs intersection of two texts';
COMMENT ON OPERATOR ^ (NONE, text) IS 'This is a prefix operator on text'; COMMENT ON OPERATOR - (NONE, text) IS 'This is a prefix operator on text';
COMMENT ON OPERATOR CLASS int4ops USING btree IS '4 byte integer operators for btrees'; COMMENT ON OPERATOR CLASS int4ops USING btree IS '4 byte integer operators for btrees';
COMMENT ON RULE my_rule ON my_table IS 'Logs updates of employee records'; COMMENT ON RULE my_rule ON my_table IS 'Logs updates of employee records';
COMMENT ON SCHEMA my_schema IS 'Departmental data'; COMMENT ON SCHEMA my_schema IS 'Departmental data';
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/parser/gram.y,v 2.491 2005/05/07 02:22:46 momjian Exp $ * $PostgreSQL: pgsql/src/backend/parser/gram.y,v 2.492 2005/06/08 21:15:28 tgl Exp $
* *
* HISTORY * HISTORY
* AUTHOR DATE MAJOR EVENT * AUTHOR DATE MAJOR EVENT
...@@ -6099,14 +6099,6 @@ a_expr: c_expr { $$ = $1; } ...@@ -6099,14 +6099,6 @@ a_expr: c_expr { $$ = $1; }
{ $$ = (Node *) makeSimpleA_Expr(AEXPR_OP, "+", NULL, $2); } { $$ = (Node *) makeSimpleA_Expr(AEXPR_OP, "+", NULL, $2); }
| '-' a_expr %prec UMINUS | '-' a_expr %prec UMINUS
{ $$ = doNegate($2); } { $$ = doNegate($2); }
| '%' a_expr
{ $$ = (Node *) makeSimpleA_Expr(AEXPR_OP, "%", NULL, $2); }
| '^' a_expr
{ $$ = (Node *) makeSimpleA_Expr(AEXPR_OP, "^", NULL, $2); }
| a_expr '%'
{ $$ = (Node *) makeSimpleA_Expr(AEXPR_OP, "%", $1, NULL); }
| a_expr '^'
{ $$ = (Node *) makeSimpleA_Expr(AEXPR_OP, "^", $1, NULL); }
| a_expr '+' a_expr | a_expr '+' a_expr
{ $$ = (Node *) makeSimpleA_Expr(AEXPR_OP, "+", $1, $3); } { $$ = (Node *) makeSimpleA_Expr(AEXPR_OP, "+", $1, $3); }
| a_expr '-' a_expr | a_expr '-' a_expr
...@@ -6468,14 +6460,6 @@ b_expr: c_expr ...@@ -6468,14 +6460,6 @@ b_expr: c_expr
{ $$ = (Node *) makeSimpleA_Expr(AEXPR_OP, "+", NULL, $2); } { $$ = (Node *) makeSimpleA_Expr(AEXPR_OP, "+", NULL, $2); }
| '-' b_expr %prec UMINUS | '-' b_expr %prec UMINUS
{ $$ = doNegate($2); } { $$ = doNegate($2); }
| '%' b_expr
{ $$ = (Node *) makeSimpleA_Expr(AEXPR_OP, "%", NULL, $2); }
| '^' b_expr
{ $$ = (Node *) makeSimpleA_Expr(AEXPR_OP, "^", NULL, $2); }
| b_expr '%'
{ $$ = (Node *) makeSimpleA_Expr(AEXPR_OP, "%", $1, NULL); }
| b_expr '^'
{ $$ = (Node *) makeSimpleA_Expr(AEXPR_OP, "^", $1, NULL); }
| b_expr '+' b_expr | b_expr '+' b_expr
{ $$ = (Node *) makeSimpleA_Expr(AEXPR_OP, "+", $1, $3); } { $$ = (Node *) makeSimpleA_Expr(AEXPR_OP, "+", $1, $3); }
| b_expr '-' b_expr | b_expr '-' b_expr
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group * Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* *
* $PostgreSQL: pgsql/src/include/catalog/pg_operator.h,v 1.132 2005/05/30 20:59:17 momjian Exp $ * $PostgreSQL: pgsql/src/include/catalog/pg_operator.h,v 1.133 2005/06/08 21:15:28 tgl Exp $
* *
* NOTES * NOTES
* the genbki.sh script reads this file and generates .bki * the genbki.sh script reads this file and generates .bki
...@@ -259,8 +259,6 @@ DATA(insert OID = 594 ( "*" PGNSP PGUID b f 701 701 701 594 0 0 0 0 0 f ...@@ -259,8 +259,6 @@ DATA(insert OID = 594 ( "*" PGNSP PGUID b f 701 701 701 594 0 0 0 0 0 f
DATA(insert OID = 595 ( "@" PGNSP PGUID l f 0 701 701 0 0 0 0 0 0 float8abs - - )); DATA(insert OID = 595 ( "@" PGNSP PGUID l f 0 701 701 0 0 0 0 0 0 float8abs - - ));
DATA(insert OID = 596 ( "|/" PGNSP PGUID l f 0 701 701 0 0 0 0 0 0 dsqrt - - )); DATA(insert OID = 596 ( "|/" PGNSP PGUID l f 0 701 701 0 0 0 0 0 0 dsqrt - - ));
DATA(insert OID = 597 ( "||/" PGNSP PGUID l f 0 701 701 0 0 0 0 0 0 dcbrt - - )); DATA(insert OID = 597 ( "||/" PGNSP PGUID l f 0 701 701 0 0 0 0 0 0 dcbrt - - ));
DATA(insert OID = 598 ( "%" PGNSP PGUID l f 0 701 701 0 0 0 0 0 0 dtrunc - - ));
DATA(insert OID = 599 ( "%" PGNSP PGUID r f 701 0 701 0 0 0 0 0 0 dround - - ));
DATA(insert OID = 1284 ( "|" PGNSP PGUID l f 0 704 702 0 0 0 0 0 0 tintervalstart - - )); DATA(insert OID = 1284 ( "|" PGNSP PGUID l f 0 704 702 0 0 0 0 0 0 tintervalstart - - ));
DATA(insert OID = 606 ( "<#>" PGNSP PGUID b f 702 702 704 0 0 0 0 0 0 mktinterval - - )); DATA(insert OID = 606 ( "<#>" PGNSP PGUID b f 702 702 704 0 0 0 0 0 0 mktinterval - - ));
DATA(insert OID = 607 ( "=" PGNSP PGUID b t 26 26 16 607 608 609 609 609 610 oideq eqsel eqjoinsel )); DATA(insert OID = 607 ( "=" PGNSP PGUID b t 26 26 16 607 608 609 609 609 610 oideq eqsel eqjoinsel ));
......
...@@ -204,7 +204,7 @@ SELECT '' AS five, f.f1, @f.f1 AS abs_f1 ...@@ -204,7 +204,7 @@ SELECT '' AS five, f.f1, @f.f1 AS abs_f1
(5 rows) (5 rows)
-- truncate -- truncate
SELECT '' AS five, f.f1, %f.f1 AS trunc_f1 SELECT '' AS five, f.f1, trunc(f.f1) AS trunc_f1
FROM FLOAT8_TBL f; FROM FLOAT8_TBL f;
five | f1 | trunc_f1 five | f1 | trunc_f1
------+----------------------+---------------------- ------+----------------------+----------------------
...@@ -216,7 +216,7 @@ SELECT '' AS five, f.f1, %f.f1 AS trunc_f1 ...@@ -216,7 +216,7 @@ SELECT '' AS five, f.f1, %f.f1 AS trunc_f1
(5 rows) (5 rows)
-- round -- round
SELECT '' AS five, f.f1, f.f1 % AS round_f1 SELECT '' AS five, f.f1, round(f.f1) AS round_f1
FROM FLOAT8_TBL f; FROM FLOAT8_TBL f;
five | f1 | round_f1 five | f1 | round_f1
------+----------------------+---------------------- ------+----------------------+----------------------
......
...@@ -203,7 +203,7 @@ SELECT '' AS five, f.f1, @f.f1 AS abs_f1 ...@@ -203,7 +203,7 @@ SELECT '' AS five, f.f1, @f.f1 AS abs_f1
(5 rows) (5 rows)
-- truncate -- truncate
SELECT '' AS five, f.f1, %f.f1 AS trunc_f1 SELECT '' AS five, f.f1, trunc(f.f1) AS trunc_f1
FROM FLOAT8_TBL f; FROM FLOAT8_TBL f;
five | f1 | trunc_f1 five | f1 | trunc_f1
------+----------------------+---------------------- ------+----------------------+----------------------
...@@ -215,7 +215,7 @@ SELECT '' AS five, f.f1, %f.f1 AS trunc_f1 ...@@ -215,7 +215,7 @@ SELECT '' AS five, f.f1, %f.f1 AS trunc_f1
(5 rows) (5 rows)
-- round -- round
SELECT '' AS five, f.f1, f.f1 % AS round_f1 SELECT '' AS five, f.f1, round(f.f1) AS round_f1
FROM FLOAT8_TBL f; FROM FLOAT8_TBL f;
five | f1 | round_f1 five | f1 | round_f1
------+----------------------+---------------------- ------+----------------------+----------------------
......
...@@ -212,7 +212,7 @@ SELECT '' AS five, f.f1, @f.f1 AS abs_f1 ...@@ -212,7 +212,7 @@ SELECT '' AS five, f.f1, @f.f1 AS abs_f1
(5 rows) (5 rows)
-- truncate -- truncate
SELECT '' AS five, f.f1, %f.f1 AS trunc_f1 SELECT '' AS five, f.f1, trunc(f.f1) AS trunc_f1
FROM FLOAT8_TBL f; FROM FLOAT8_TBL f;
five | f1 | trunc_f1 five | f1 | trunc_f1
------+----------------------+---------------------- ------+----------------------+----------------------
...@@ -224,7 +224,7 @@ SELECT '' AS five, f.f1, %f.f1 AS trunc_f1 ...@@ -224,7 +224,7 @@ SELECT '' AS five, f.f1, %f.f1 AS trunc_f1
(5 rows) (5 rows)
-- round -- round
SELECT '' AS five, f.f1, f.f1 % AS round_f1 SELECT '' AS five, f.f1, round(f.f1) AS round_f1
FROM FLOAT8_TBL f; FROM FLOAT8_TBL f;
five | f1 | round_f1 five | f1 | round_f1
------+----------------------+---------------------- ------+----------------------+----------------------
......
...@@ -212,7 +212,7 @@ SELECT '' AS five, f.f1, @f.f1 AS abs_f1 ...@@ -212,7 +212,7 @@ SELECT '' AS five, f.f1, @f.f1 AS abs_f1
(5 rows) (5 rows)
-- truncate -- truncate
SELECT '' AS five, f.f1, %f.f1 AS trunc_f1 SELECT '' AS five, f.f1, trunc(f.f1) AS trunc_f1
FROM FLOAT8_TBL f; FROM FLOAT8_TBL f;
five | f1 | trunc_f1 five | f1 | trunc_f1
------+----------------------+---------------------- ------+----------------------+----------------------
...@@ -224,7 +224,7 @@ SELECT '' AS five, f.f1, %f.f1 AS trunc_f1 ...@@ -224,7 +224,7 @@ SELECT '' AS five, f.f1, %f.f1 AS trunc_f1
(5 rows) (5 rows)
-- round -- round
SELECT '' AS five, f.f1, f.f1 % AS round_f1 SELECT '' AS five, f.f1, round(f.f1) AS round_f1
FROM FLOAT8_TBL f; FROM FLOAT8_TBL f;
five | f1 | round_f1 five | f1 | round_f1
------+----------------------+---------------------- ------+----------------------+----------------------
......
...@@ -204,7 +204,7 @@ SELECT '' AS five, f.f1, @f.f1 AS abs_f1 ...@@ -204,7 +204,7 @@ SELECT '' AS five, f.f1, @f.f1 AS abs_f1
(5 rows) (5 rows)
-- truncate -- truncate
SELECT '' AS five, f.f1, %f.f1 AS trunc_f1 SELECT '' AS five, f.f1, trunc(f.f1) AS trunc_f1
FROM FLOAT8_TBL f; FROM FLOAT8_TBL f;
five | f1 | trunc_f1 five | f1 | trunc_f1
------+----------------------+---------------------- ------+----------------------+----------------------
...@@ -216,7 +216,7 @@ SELECT '' AS five, f.f1, %f.f1 AS trunc_f1 ...@@ -216,7 +216,7 @@ SELECT '' AS five, f.f1, %f.f1 AS trunc_f1
(5 rows) (5 rows)
-- round -- round
SELECT '' AS five, f.f1, f.f1 % AS round_f1 SELECT '' AS five, f.f1, round(f.f1) AS round_f1
FROM FLOAT8_TBL f; FROM FLOAT8_TBL f;
five | f1 | round_f1 five | f1 | round_f1
------+----------------------+---------------------- ------+----------------------+----------------------
......
...@@ -79,11 +79,11 @@ SELECT '' AS five, f.f1, @f.f1 AS abs_f1 ...@@ -79,11 +79,11 @@ SELECT '' AS five, f.f1, @f.f1 AS abs_f1
FROM FLOAT8_TBL f; FROM FLOAT8_TBL f;
-- truncate -- truncate
SELECT '' AS five, f.f1, %f.f1 AS trunc_f1 SELECT '' AS five, f.f1, trunc(f.f1) AS trunc_f1
FROM FLOAT8_TBL f; FROM FLOAT8_TBL f;
-- round -- round
SELECT '' AS five, f.f1, f.f1 % AS round_f1 SELECT '' AS five, f.f1, round(f.f1) AS round_f1
FROM FLOAT8_TBL f; FROM FLOAT8_TBL f;
-- ceil / ceiling -- ceil / ceiling
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment