Re: Some surprising precedence behavior in PG's grammar

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: Some surprising precedence behavior in PG's grammar
Date: 2011-05-06 00:42:23
Message-ID: 28908.1304642543@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

I wrote:
> Andrew Dunstan <andrew(at)dunslane(dot)net> writes:
>> If we do need a precedence setting for NULL_P, then I think it should
>> probably be on its own and not sharing one with IS.

> Yeah, I was thinking that too. If we put %prec on the IS [NOT] NULL
> productions then there is no need for NULL_P to have exactly its current
> precedence; anything above POSTFIXOP would preserve the current behavior
> in the DEFAULT ... NULL case. (And if we decided we wanted to flip that
> behavior, anything below POSTFIXOP would do that.)

On reflection I decided that the best quick-fix is to put NULL into the
list of keywords that are already precedence-grouped with IDENT. That
at least makes sure that it has precedence behavior equivalent to any
plain old non-keyword. If you can find a better fix, maybe we could
apply it to the other cases mentioned there as well.

> BTW, I wonder why NOTNULL and ISNULL have their own precedence levels,
> rather than being made to act exactly like IS [NOT] NULL ...

Is anybody up for changing that, or should we leave well enough alone?

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2011-05-06 00:45:30 Re: Process wakeups when idle and power consumption
Previous Message Peter Geoghegan 2011-05-06 00:41:38 Re: Process wakeups when idle and power consumption