Re: Some surprising precedence behavior in PG's grammar - Mailing list pgsql-hackers

From Greg Stark
Subject Re: Some surprising precedence behavior in PG's grammar
Date
Msg-id BANLkTimux=065doRc8oMK7KWJs16hKppuw@mail.gmail.com
Whole thread Raw
In response to Re: Some surprising precedence behavior in PG's grammar  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Thu, May 5, 2011 at 4:03 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Greg Stark <gsstark@mit.edu> writes:
>> Isn't there already some gadget which forces postfix operators to be
>> discouraged compared to some other interpretation in other cases?
>
> Yeah.  I'm not unhappy with the current grammar's behavior in this case.
> What's bothering me is that the implementation seems likely to create
> surprising/unexpected behaviors after future grammar changes.

I do wonder how much we really gain from having postfix operators.
Other than ! I've never seen one and of course anyone who wanted to
use one could just as easily use a prefix operator. In practice I
think most unary operators are just special cases of binary operators
anyways and often once you have the binary operator it's clearer to
just use that anyways.

A *lot* of grammar conflicts we've had to worry about end up going
away if we didn't have postfix operators.
--
greg


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Some surprising precedence behavior in PG's grammar
Next
From: Dimitri Fontaine
Date:
Subject: Re: patch for new feature: Buffer Cache Hibernation