agora inbox for [email protected]  
help / color / mirror / Atom feed
From: Adriaan Joubert <[email protected]>
To: Tom Lane <[email protected]>
Cc: Postgresql <[email protected]>
Cc: Thomas Lockhart <[email protected]>
Subject: Re: [HACKERS] Operator definitions
Date: Thu, 23 Sep 1999 10:45:09 +0300
Message-ID: <[email protected]> (raw)
References: <[email protected]>

> 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 ----


Attachments:

  [text/plain] pgram (703B, ../[email protected]/2-pgram)
  download | inline:
*** 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 ----

view thread (15+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected]
  Subject: Re: [HACKERS] Operator definitions
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox