Re: [HACKERS] Operator definitions - Mailing list pgsql-hackers

From Adriaan Joubert
Subject Re: [HACKERS] Operator definitions
Date
Msg-id 37E9DA85.F0210261@albourne.com
Whole thread Raw
In response to Re: [HACKERS] Operator definitions  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: [HACKERS] Operator definitions
List pgsql-hackers
> It looks to me like '^' and '|' have been left out of the alternatives
> for MathOp in src/backend/parser/gram.y.  It could be they were
> deliberately omitted, but I bet it's just an oversight.

OK, here is a patch to allow both ^ and | as operators, both in operator
definitions and expressions. It seems to work for me. Unfortunately the
regression tests do not tell me an awful lot, as several of them fail on
the Alpha anyway. As I don;t really know what I'm doing, I'd appreciate
it if somebody else could check the patch out and let me know whether it
is ok.

Cheers,

Adriaan*** src/backend/parser/gram.y    Thu Sep 23 10:36:47 1999
--- src/backend/parser/gram.y.orig    Tue Sep 14 09:07:35 1999
***************
*** 2021,2028 ****
          | '*'            { $$ = "*"; }
          | '/'            { $$ = "/"; }
          | '%'            { $$ = "%"; }
-         | '^'            { $$ = "^"; }
-         | '|'            { $$ = "|"; }
          | '<'            { $$ = "<"; }
          | '>'            { $$ = ">"; }
          | '='            { $$ = "="; }
--- 2021,2026 ----
***************
*** 3666,3673 ****
                  {    $$ = 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
--- 3664,3669 ----

pgsql-hackers by date:

Previous
From: Adam Haberlach
Date:
Subject: ...
Next
From: wieck@debis.com (Jan Wieck)
Date:
Subject: Re: [HACKERS] Compile timing