Re: [HACKERS] Operator definitions

Поиск
Список
Период
Сортировка
От Adriaan Joubert
Тема Re: [HACKERS] Operator definitions
Дата
Msg-id 37E9DA85.F0210261@albourne.com
обсуждение исходный текст
Ответ на Re: [HACKERS] Operator definitions  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: [HACKERS] Operator definitions  (Tom Lane <tgl@sss.pgh.pa.us>)
Список 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 по дате отправления:

Предыдущее
От: Adam Haberlach
Дата:
Сообщение: ...
Следующее
От: wieck@debis.com (Jan Wieck)
Дата:
Сообщение: Re: [HACKERS] Compile timing