"Tom Lane" <tgl@sss.pgh.pa.us> writes:
> Gregory Stark <stark@enterprisedb.com> writes:
>> But yeah, c_expr isn't enough. We really need {a,b}_expr sans postfix
>> expressions.
>
> How's that going to help? As long as postfix operators exist at all,
>
> SELECT a + b, ...
>
> is going to be ambiguous, and no amount of grammar magic changes that.
> We could force the parser into using one interpretation or the other,
> but it would still be wrong for some folks.
Sure, just like a + + b is ambiguous. We define an arbitrary choice and tell
people to put parentheses if they want the other. It's not too hard to write
SELECT (a +) b, ...
if you want an alias. Besides, nobody uses postfix expressions anyways. It
would be a pain if it worked the other way and you had to write (a + b) all
the time.
-- Gregory Stark EnterpriseDB http://www.enterprisedb.com Get trained by Bruce Momjian - ask me about
EnterpriseDB'sPostgreSQL training!