Re: factorial function/phase out postfix operators?
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
Cc: Robert Haas <robertmhaas@gmail.com>,
Vik Fearing <vik@postgresfriends.org>,
pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2020-05-25T22:18:25Z
Lists: pgsql-hackers
Peter Eisentraut <peter.eisentraut@2ndquadrant.com> writes: > What I was hoping to get out of this was to resolve some of the weird > precedence hacks that were blamed on postfix operators. Yeah, I was thinking about that too, but hadn't gotten to it. > But building on your patch, the best I could achieve was > -%nonassoc IDENT GENERATED NULL_P PARTITION RANGE ROWS GROUPS PRECEDING > FOLLOWING CUBE ROLLUP > +%nonassoc IDENT PARTITION RANGE ROWS GROUPS PRECEDING FOLLOWING CUBE > ROLLUP > which is a pretty poor yield. I'd hoped for better as well. Still, it's possible this would save us from greater pain in the future, seeing that the SQL committee seems resolutely uninterested in whether the syntax they invent is parsable. (Also, there are other factors here: I think at least some of those precedence hacks are there to avoid fully reserving the associated keywords.) > Maybe this isn't worth it after all. It'd be nice to have a better yield from removing a user-visible feature. Perhaps there would be no complaints about removing postfix ops, but if there are I want to be able to point to some substantial benefit that users get from it. (Which is why I focused on the optional-AS business to start with ... users don't care about how many precedence hacks we need.) regards, tom lane
Commits
-
Remove precedence hacks no longer needed without postfix operators.
- 28a61fc6c58f 14.0 landed
-
Allow most keywords to be used as column labels without requiring AS.
- 06a7c3154f5b 14.0 landed
-
Remove support for postfix (right-unary) operators.
- 1ed6b895634c 14.0 landed
-
Remove factorial operators, leaving only the factorial() function.
- 76f412ab3105 14.0 landed
-
Further refine patch for commenting operator implementation functions.
- 908ab8028640 9.1.0 cited