summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2000-03-18 04:32:35 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2000-03-18 04:32:35 +0000
commit15115344f02576d9671177f8f68bba53c9afa929 (patch)
treeae5ab9e01bfd98a2ed3b1e55b802f8ccb72633ad
parentcaa6fc1ba2504863b0e106eb818c2d0e81a5f794 (diff)
downloadpostgresql-15115344f02576d9671177f8f68bba53c9afa929.tar.gz
Just noticed that the grammar actually has no provision for '+' as a
prefix operator :-(. Bad enough that we have no implementation of unary plus, but at least with this fix the grammar will take it.
-rw-r--r--src/backend/parser/gram.y11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y
index 40ad6ffb6c..7508066034 100644
--- a/src/backend/parser/gram.y
+++ b/src/backend/parser/gram.y
@@ -11,7 +11,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 2.158 2000/03/18 00:33:45 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 2.159 2000/03/18 04:32:35 tgl Exp $
*
* HISTORY
* AUTHOR DATE MAJOR EVENT
@@ -4168,6 +4168,8 @@ a_expr: c_expr
* If you add more explicitly-known operators, be sure to add them
* also to b_expr and to the MathOp list above.
*/
+ | '+' a_expr %prec UMINUS
+ { $$ = makeA_Expr(OP, "+", NULL, $2); }
| '-' a_expr %prec UMINUS
{ $$ = doNegate($2); }
| '%' a_expr
@@ -4384,6 +4386,8 @@ b_expr: c_expr
{ $$ = $1; }
| b_expr TYPECAST Typename
{ $$ = makeTypeCast($1, $3); }
+ | '+' b_expr %prec UMINUS
+ { $$ = makeA_Expr(OP, "+", NULL, $2); }
| '-' b_expr %prec UMINUS
{ $$ = doNegate($2); }
| '%' b_expr
@@ -5480,8 +5484,9 @@ mapTargetColumns(List *src, List *dst)
* Do not convert "float", since that is handled elsewhere
* for FLOAT(p) syntax.
*
- * Converting "datetime" to "timestamp" is a temporary expedient for
- * pre-7.0 to 7.0 compatibility; it should go away again someday.
+ * Converting "datetime" to "timestamp" and "timespan" to "interval"
+ * is a temporary expedient for pre-7.0 to 7.0 compatibility;
+ * these should go away someday.
*/
static char *
xlateSqlFunc(char *name)