Re: factorial function/phase out postfix operators?
John Naylor <john.naylor@2ndquadrant.com>
From: John Naylor <john.naylor@2ndquadrant.com>
To: Mark Dilger <mark.dilger@enterprisedb.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>, Robert Haas <robertmhaas@gmail.com>, Vik Fearing <vik@postgresfriends.org>, Peter Eisentraut <peter.eisentraut@2ndquadrant.com>, pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2020-07-18T08:00:12Z
Lists: pgsql-hackers
On Sat, Jul 11, 2020 at 1:14 AM Mark Dilger <mark.dilger@enterprisedb.com> wrote: > > > Tom and Álvaro discussed upthread: > > > >> Would it make sense (and possible) to have a keyword category that is > >> not disjoint wrt. the others? Maybe that ends up being easier than > >> a solution that ends up with six or seven categories. > > Version 2, attached, follows this design, increasing the number of keywords that can be used as column aliases without the AS keyword up to 411, with only 39 keywords still requiring an explicit preceding AS. Hi Mark, This isn't a full review, but I have a few questions/comments: By making col-label-ness an orthogonal attribute, do we still need the category of non_label_keyword? It seems not. pg_get_keywords() should probably have a column to display ability to act as a bare col label. Perhaps a boolean? If so, what do you think of using true/false for the new field in kwlist.h as well? In the bikeshedding department, it seems "implicit" was chosen because it was distinct from "bare". I think "bare" as a descriptor should be kept throughout for readability's sake. Maybe BareColLabel could be "IDENT or bare_label_keyword" for example. Same for the $status var. Likewise, it seems the actual removal of postfix operators should be a separate patch. -- John Naylor https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
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