Re: factorial function/phase out postfix operators?
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Robert Haas <robertmhaas@gmail.com>
Cc: Vik Fearing <vik@postgresfriends.org>,
Peter Eisentraut <peter.eisentraut@2ndquadrant.com>,
pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2020-05-19T23:47:11Z
Lists: pgsql-hackers
Attachments
- bison-hack-for-optional-AS.patch (text/x-diff) patch
I wrote: > However, we do have to have a benefit to show those people whose > queries we break. Hence my insistence on having a working AS fix > (or some other benefit) before not after. I experimented with this a bit more, and came up with the attached. It's not a working patch, just a set of grammar changes that Bison is happy with. (Getting to a working patch would require fixing the various build infrastructure that knows about the keyword classification, which seems straightforward but tedious.) As Robert theorized, it works to move a fairly-small number of unreserved keywords into a new slightly-reserved category. However, as the patch stands, only the remaining fully-unreserved keywords can be used as bare column labels. I'd hoped to be able to also use col_name keywords in that way (which'd make the set of legal bare column labels mostly the same as ColId). The col_name keywords that cause problems are, it appears, only PRECISION, CHARACTER, and CHAR_P. So in principle we could move those three into yet another keyword category and then let the remaining col_name keywords be included in BareColLabel. I kind of think that that's more complication than it's worth, though. 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