aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/backend/parser/gram.y20
-rw-r--r--src/backend/parser/scan.l4
2 files changed, 20 insertions, 4 deletions
diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y
index 88438af70c8..9249fd044a4 100644
--- a/src/backend/parser/gram.y
+++ b/src/backend/parser/gram.y
@@ -10,7 +10,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 2.86 1999/07/04 04:55:59 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 2.87 1999/07/08 00:00:42 momjian Exp $
*
* HISTORY
* AUTHOR DATE MAJOR EVENT
@@ -349,7 +349,7 @@ Oid param_type(int t); /* used in parse_expr.c */
%nonassoc NULL_P
%nonassoc IS
%left '+' '-'
-%left '*' '/' '%'
+%left '*' '/' '%' '^'
%left '|' /* this is the relation union op, not logical or */
/* Unary Operators */
%right ':'
@@ -973,6 +973,8 @@ default_expr: AexprConst
{ $$ = nconc( $1, lcons( makeString( "%"), $3)); }
| default_expr '*' default_expr
{ $$ = nconc( $1, lcons( makeString( "*"), $3)); }
+ | default_expr '^' default_expr
+ { $$ = nconc( $1, lcons( makeString( "^"), $3)); }
| default_expr '=' default_expr
{ elog(ERROR,"boolean expressions not supported in DEFAULT"); }
| default_expr '<' default_expr
@@ -1121,6 +1123,8 @@ constraint_expr: AexprConst
{ $$ = nconc( $1, lcons( makeString( "%"), $3)); }
| constraint_expr '*' constraint_expr
{ $$ = nconc( $1, lcons( makeString( "*"), $3)); }
+ | constraint_expr '^' constraint_expr
+ { $$ = nconc( $1, lcons( makeString( "^"), $3)); }
| constraint_expr '=' constraint_expr
{ $$ = nconc( $1, lcons( makeString( "="), $3)); }
| constraint_expr '<' constraint_expr
@@ -3641,8 +3645,12 @@ a_expr: attr opt_indirection
{ $$ = doNegate($2); }
| '%' a_expr
{ $$ = makeA_Expr(OP, "%", NULL, $2); }
+ | '^' a_expr
+ { $$ = makeA_Expr(OP, "^", NULL, $2); }
| a_expr '%'
{ $$ = makeA_Expr(OP, "%", $1, NULL); }
+ | a_expr '^'
+ { $$ = makeA_Expr(OP, "^", $1, NULL); }
| a_expr '+' a_expr
{ $$ = makeA_Expr(OP, "+", $1, $3); }
| a_expr '-' a_expr
@@ -3653,6 +3661,8 @@ a_expr: attr opt_indirection
{ $$ = makeA_Expr(OP, "%", $1, $3); }
| a_expr '*' a_expr
{ $$ = makeA_Expr(OP, "*", $1, $3); }
+ | a_expr '^' a_expr
+ { $$ = makeA_Expr(OP, "^", $1, $3); }
| a_expr '<' a_expr
{ $$ = makeA_Expr(OP, "<", $1, $3); }
| a_expr '>' a_expr
@@ -4302,8 +4312,12 @@ b_expr: attr opt_indirection
{ $$ = doNegate($2); }
| '%' b_expr
{ $$ = makeA_Expr(OP, "%", NULL, $2); }
+ | '^' b_expr
+ { $$ = makeA_Expr(OP, "^", NULL, $2); }
| b_expr '%'
{ $$ = makeA_Expr(OP, "%", $1, NULL); }
+ | b_expr '^'
+ { $$ = makeA_Expr(OP, "^", $1, NULL); }
| b_expr '+' b_expr
{ $$ = makeA_Expr(OP, "+", $1, $3); }
| b_expr '-' b_expr
@@ -4312,6 +4326,8 @@ b_expr: attr opt_indirection
{ $$ = makeA_Expr(OP, "/", $1, $3); }
| b_expr '%' b_expr
{ $$ = makeA_Expr(OP, "%", $1, $3); }
+ | b_expr '^' b_expr
+ { $$ = makeA_Expr(OP, "^", $1, $3); }
| b_expr '*' b_expr
{ $$ = makeA_Expr(OP, "*", $1, $3); }
| ':' b_expr
diff --git a/src/backend/parser/scan.l b/src/backend/parser/scan.l
index 6493ce2db4b..6389f0bfe43 100644
--- a/src/backend/parser/scan.l
+++ b/src/backend/parser/scan.l
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/parser/scan.l,v 1.49 1999/05/12 07:12:51 thomas Exp $
+ * $Header: /cvsroot/pgsql/src/backend/parser/scan.l,v 1.50 1999/07/08 00:00:43 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -155,7 +155,7 @@ identifier {letter}{letter_or_digit}*
typecast "::"
-self [,()\[\].;$\:\+\-\*\/\%\<\>\=\|]
+self [,()\[\].;$\:\+\-\*\/\%\^\<\>\=\|]
op_and_self [\~\!\@\#\^\&\|\`\?\$\:\+\-\*\/\%\<\>\=]
operator {op_and_self}+