Re: Some surprising precedence behavior in PG's grammar

From: Greg Stark <gsstark(at)mit(dot)edu>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Some surprising precedence behavior in PG's grammar
Date: 2011-05-05 03:19:56
Message-ID: BANLkTimux=065doRc8oMK7KWJs16hKppuw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, May 5, 2011 at 4:03 AM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Greg Stark <gsstark(at)mit(dot)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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Rob Wultsch 2011-05-05 07:25:34 Re: Unlogged vs. In-Memory
Previous Message Tom Lane 2011-05-05 03:03:00 Re: Some surprising precedence behavior in PG's grammar