Index: gram.y =================================================================== RCS file: /usr/local/cvsroot/pgsql/src/backend/parser/gram.y,v retrieving revision 2.100 retrieving revision 2.103 diff -c -r2.100 -r2.103 *** gram.y 1999/09/28 04:34:44 2.100 --- gram.y 1999/09/28 14:49:36 2.103 *************** *** 10,16 **** * * * IDENTIFICATION ! * $Header: /usr/local/cvsroot/pgsql/src/backend/parser/gram.y,v 2.100 1999/09/28 04:34:44 momjian Exp $ * * HISTORY * AUTHOR DATE MAJOR EVENT --- 10,16 ---- * * * IDENTIFICATION ! * $Header: /usr/local/cvsroot/pgsql/src/backend/parser/gram.y,v 2.103 1999/09/28 14:49:36 momjian Exp $ * * HISTORY * AUTHOR DATE MAJOR EVENT *************** *** 977,982 **** --- 977,984 ---- { $$ = 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 *************** *** 1127,1132 **** --- 1129,1136 ---- { $$ = 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 *************** *** 2042,2047 **** --- 2046,2053 ---- | '*' { $$ = "*"; } | '/' { $$ = "/"; } | '%' { $$ = "%"; } + | '^' { $$ = "^"; } + | '|' { $$ = "|"; } | '<' { $$ = "<"; } | '>' { $$ = ">"; } | '=' { $$ = "="; } *************** *** 3638,3643 **** --- 3644,3651 ---- | '*' { $$ = "*"; } | '/' { $$ = "/"; } | '%' { $$ = "%"; } + | '^' { $$ = "^"; } + | '|' { $$ = "|"; } ; sub_type: ANY { $$ = ANY_SUBLINK; } *************** *** 3672,3693 **** { $$ = 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 { $$ = 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 { $$ = makeA_Expr(OP, "^", $1, $3); } | a_expr '<' a_expr { $$ = makeA_Expr(OP, "<", $1, $3); } | a_expr '>' a_expr --- 3680,3711 ---- { $$ = makeA_Expr(OP, "%", NULL, $2); } | '^' a_expr { $$ = makeA_Expr(OP, "^", NULL, $2); } + | '|' a_expr + { $$ = makeA_Expr(OP, "|", NULL, $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 '|' + { $$ = makeA_Expr(OP, "|", $1, NULL); } | 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 { $$ = 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 { $$ = makeA_Expr(OP, "<", $1, $3); } | a_expr '>' a_expr *************** *** 3701,3712 **** | a_expr '=' a_expr { $$ = makeA_Expr(OP, "=", $1, $3); } - | ':' a_expr - { $$ = makeA_Expr(OP, ":", NULL, $2); } - | ';' a_expr - { $$ = makeA_Expr(OP, ";", NULL, $2); } - | '|' a_expr - { $$ = makeA_Expr(OP, "|", NULL, $2); } | a_expr TYPECAST Typename { $$ = (Node *)$1; --- 3719,3724 ---- *************** *** 4089,4094 **** --- 4101,4116 ---- n->subselect = $4; $$ = (Node *)n; } + | a_expr '*' '(' SubSelect ')' + { + SubLink *n = makeNode(SubLink); + n->lefthand = lcons($1, NULL); + n->oper = lcons("*",NIL); + n->useor = false; + n->subLinkType = EXPR_SUBLINK; + n->subselect = $4; + $$ = (Node *)n; + } | a_expr '/' '(' SubSelect ')' { SubLink *n = makeNode(SubLink); *************** *** 4109,4124 **** n->subselect = $4; $$ = (Node *)n; } ! | a_expr '*' '(' SubSelect ')' { SubLink *n = makeNode(SubLink); n->lefthand = lcons($1, NULL); ! n->oper = lcons("*",NIL); n->useor = false; n->subLinkType = EXPR_SUBLINK; n->subselect = $4; $$ = (Node *)n; } | a_expr '<' '(' SubSelect ')' { SubLink *n = makeNode(SubLink); --- 4131,4156 ---- n->subselect = $4; $$ = (Node *)n; } ! | a_expr '^' '(' SubSelect ')' { SubLink *n = makeNode(SubLink); n->lefthand = lcons($1, NULL); ! n->oper = lcons("^",NIL); n->useor = false; n->subLinkType = EXPR_SUBLINK; n->subselect = $4; $$ = (Node *)n; } + | a_expr '|' '(' SubSelect ')' + { + SubLink *n = makeNode(SubLink); + n->lefthand = lcons($1, NULL); + n->oper = lcons("|",NIL); + n->useor = false; + n->subLinkType = EXPR_SUBLINK; + n->subselect = $4; + $$ = (Node *)n; + } | a_expr '<' '(' SubSelect ')' { SubLink *n = makeNode(SubLink); *************** *** 4179,4184 **** --- 4211,4226 ---- n->subselect = $5; $$ = (Node *)n; } + | a_expr '*' ANY '(' SubSelect ')' + { + SubLink *n = makeNode(SubLink); + n->lefthand = lcons($1,NIL); + n->oper = lcons("*",NIL); + n->useor = false; + n->subLinkType = ANY_SUBLINK; + n->subselect = $5; + $$ = (Node *)n; + } | a_expr '/' ANY '(' SubSelect ')' { SubLink *n = makeNode(SubLink); *************** *** 4199,4209 **** n->subselect = $5; $$ = (Node *)n; } ! | a_expr '*' ANY '(' SubSelect ')' { SubLink *n = makeNode(SubLink); n->lefthand = lcons($1,NIL); ! n->oper = lcons("*",NIL); n->useor = false; n->subLinkType = ANY_SUBLINK; n->subselect = $5; --- 4241,4261 ---- n->subselect = $5; $$ = (Node *)n; } ! | a_expr '^' ANY '(' SubSelect ')' { SubLink *n = makeNode(SubLink); n->lefthand = lcons($1,NIL); ! n->oper = lcons("^",NIL); ! n->useor = false; ! n->subLinkType = ANY_SUBLINK; ! n->subselect = $5; ! $$ = (Node *)n; ! } ! | a_expr '|' ANY '(' SubSelect ')' ! { ! SubLink *n = makeNode(SubLink); ! n->lefthand = lcons($1,NIL); ! n->oper = lcons("|",NIL); n->useor = false; n->subLinkType = ANY_SUBLINK; n->subselect = $5; *************** *** 4269,4274 **** --- 4321,4336 ---- n->subselect = $5; $$ = (Node *)n; } + | a_expr '*' ALL '(' SubSelect ')' + { + SubLink *n = makeNode(SubLink); + n->lefthand = lcons($1, NULL); + n->oper = lcons("*",NIL); + n->useor = false; + n->subLinkType = ALL_SUBLINK; + n->subselect = $5; + $$ = (Node *)n; + } | a_expr '/' ALL '(' SubSelect ')' { SubLink *n = makeNode(SubLink); *************** *** 4289,4299 **** n->subselect = $5; $$ = (Node *)n; } ! | a_expr '*' ALL '(' SubSelect ')' { SubLink *n = makeNode(SubLink); n->lefthand = lcons($1, NULL); ! n->oper = lcons("*",NIL); n->useor = false; n->subLinkType = ALL_SUBLINK; n->subselect = $5; --- 4351,4371 ---- n->subselect = $5; $$ = (Node *)n; } ! | a_expr '^' ALL '(' SubSelect ')' { SubLink *n = makeNode(SubLink); n->lefthand = lcons($1, NULL); ! n->oper = lcons("^",NIL); ! n->useor = false; ! n->subLinkType = ALL_SUBLINK; ! n->subselect = $5; ! $$ = (Node *)n; ! } ! | a_expr '|' ALL '(' SubSelect ')' ! { ! SubLink *n = makeNode(SubLink); ! n->lefthand = lcons($1, NULL); ! n->oper = lcons("|",NIL); n->useor = false; n->subLinkType = ALL_SUBLINK; n->subselect = $5; *************** *** 4363,4390 **** { $$ = 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 { $$ = 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 '^' b_expr { $$ = makeA_Expr(OP, "^", $1, $3); } ! | ':' b_expr ! { $$ = makeA_Expr(OP, ":", NULL, $2); } ! | ';' b_expr ! { $$ = makeA_Expr(OP, ";", NULL, $2); } ! | '|' b_expr ! { $$ = makeA_Expr(OP, "|", NULL, $2); } | b_expr TYPECAST Typename { $$ = (Node *)$1; --- 4435,4466 ---- { $$ = makeA_Expr(OP, "%", NULL, $2); } | '^' b_expr { $$ = makeA_Expr(OP, "^", NULL, $2); } + | '|' b_expr + { $$ = makeA_Expr(OP, "|", NULL, $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 '|' + { $$ = makeA_Expr(OP, "|", $1, NULL); } | 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 '/' 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 '|' b_expr ! { $$ = makeA_Expr(OP, "|", $1, $3); } | b_expr TYPECAST Typename { $$ = (Node *)$1;