Re: [HACKERS] Operator definitions

From: Bruce Momjian <maillist(at)candle(dot)pha(dot)pa(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Adriaan Joubert <a(dot)joubert(at)albourne(dot)com>, Postgresql <pgsql-hackers(at)postgreSQL(dot)org>, Thomas Lockhart <lockhart(at)alumni(dot)caltech(dot)edu>
Subject: Re: [HACKERS] Operator definitions
Date: 1999-09-28 14:31:03
Message-ID: 199909281431.KAA18169@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> Adriaan Joubert <a(dot)joubert(at)albourne(dot)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(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 1999-09-28 14:39:22 Re: [HACKERS] Recovery on incomplete write
Previous Message Thomas Lockhart 1999-09-28 14:11:04 Re: RI and PARSER (was: Re: [HACKERS] RI status report #1)