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

From Bruce Momjian
Subject Re: [HACKERS] Operator definitions
Date
Msg-id 199909281431.KAA18169@candle.pha.pa.us
Whole thread Raw
In response to Re: [HACKERS] Operator definitions  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
> Adriaan Joubert <a.joubert@albourne.com> writes:
> > 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.
>
> If you search for, eg, '%', you will find there are several production
> lists that call out all the operators; your patch only caught one of them.
>
> This is a real pain in the neck to maintain, but AFAIK we couldn't
> collapse the productions into a single one using MathOp without losing
> operator precedence info :-(
>
> It might be helpful if gram.y had annotations like "# Here be MathOps"
> so that you could search for the darn things and make sure you had
> adjusted each and every production list whenever you added/deleted one.

OK, I have applied a patch to fix all the operator cases for ^ and |.
This will be in 6.6.

The issue is that we want to specify precedence for the common math
operators, and I needed to be able to specify precedence for '|' so people
could do SELECT 'A' | 'B' | 'C'.


--
  Bruce Momjian                        |  http://www.op.net/~candle
  maillist@candle.pha.pa.us            |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026


pgsql-hackers by date:

Previous
From: Thomas Lockhart
Date:
Subject: Re: RI and PARSER (was: Re: [HACKERS] RI status report #1)
Next
From: Tom Lane
Date:
Subject: Re: [HACKERS] Recovery on incomplete write