Re: [HACKERS] open 6.4 items - Mailing list pgsql-hackers

From Bruce Momjian
Subject Re: [HACKERS] open 6.4 items
Date
Msg-id 199809101759.NAA02672@candle.pha.pa.us
Whole thread Raw
In response to Re: [HACKERS] open 6.4 items  ("Thomas G. Lockhart" <lockhart@alumni.caltech.edu>)
List pgsql-hackers
> > allow multiple generic operators in expressions without the use of
> >   parentheses
>
> I could just let this one go until it dies a quiet death, but...
>
> To parse "multiple generic operators", per the example
>
>   select oid @ oid @ oid from table;
>
> one would have to change the associativity of many operators from
> non-associative (the correct assumption) to left- or right associative
> (the wrong thing to do). If we are going to allow operator extensibility
> we cannot make assumptions about the precedence order of operators, and
> should require parentheses to break the ambiguity.
>
> Unless someone has a good proposal on how to change the standard rules
> of arithmetic, or on how to change the parser to allow
> operator-dependent precedence in an extensible way, then we shouldn't
> bother tracking this as a problem statement imho.

I agree, except the error message returned from the parser is quite
confusing, just stating 'parse error'.  In fact, it took me 10 minutes
to figure out what would and wouldn't work, and I had no idea that
parentheses would fix it.

If we can't give a better error message, we have to keep it on the
todo/bugs list until we can tell people what they are doing wrong, and
how to fix it.

--
Bruce Momjian                          |  830 Blythe Avenue
maillist@candle.pha.pa.us              |  Drexel Hill, Pennsylvania 19026
  +  If your life is a hard drive,     |  (610) 353-9879(w)
  +  Christ can be your backup.        |  (610) 853-3000(h)

pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: [HACKERS] more on int8
Next
From: "Joost Kraaijeveld"
Date:
Subject: Porting postgreSQL to Windows NT