Re: factorial function/phase out postfix operators?

Alvaro Herrera <alvherre@2ndquadrant.com>

From: Alvaro Herrera <alvherre@2ndquadrant.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Robert Haas <robertmhaas@gmail.com>, Vik Fearing <vik@postgresfriends.org>, Peter Eisentraut <peter.eisentraut@2ndquadrant.com>, pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2020-05-20T21:54:18Z
Lists: pgsql-hackers
On 2020-May-20, Tom Lane wrote:

> I too failed to save the results of some experimentation, but I'd
> also poked at the type_func_name_keyword category, and it has a similar
> situation where only about three keywords cause problems if included
> in BareColLabel.  So we could possibly get another twenty-ish keywords
> into that set with yet a third new keyword category.  But (a) we'd still
> only be at 79% coverage and (b) this is *really* making things messy
> keyword-category-wise.  I feel like we'd be better advised to somehow
> treat can-be-bare-col-label as an independent classification.
> 
> (I did not look at whether any of the fully-reserved keywords could
> be made safe to use, but it seems likely that at least some of them
> could be, if we accept even more classification mess.)

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.

-- 
Álvaro Herrera                https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services



Commits

  1. Remove precedence hacks no longer needed without postfix operators.

  2. Allow most keywords to be used as column labels without requiring AS.

  3. Remove support for postfix (right-unary) operators.

  4. Remove factorial operators, leaving only the factorial() function.

  5. Further refine patch for commenting operator implementation functions.