Re: factorial function/phase out postfix operators?

Mark Dilger <mark.dilger@enterprisedb.com>

From: Mark Dilger <mark.dilger@enterprisedb.com>
To: John Naylor <john.naylor@2ndquadrant.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>, Peter Eisentraut <peter.eisentraut@2ndquadrant.com>, pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2020-08-24T15:04:00Z
Lists: pgsql-hackers

> On Aug 24, 2020, at 12:28 AM, John Naylor <john.naylor@2ndquadrant.com> wrote:
> 
> On Tue, May 19, 2020 at 5:03 AM Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> 
>> Peter Eisentraut <peter.eisentraut@2ndquadrant.com> writes:
>>> What are the thoughts about then marking the postfix operator deprecated
>>> and eventually removing it?
>> 
>> If we do this it'd require a plan.  We'd have to also warn about the
>> feature deprecation in (at least) the CREATE OPERATOR man page, and
>> we'd have to decide how many release cycles the deprecation notices
>> need to stand for.
>> 
>> If that's the intention, though, it'd be good to get those deprecation
>> notices published in v13 not v14.
> 
> I imagine the release candidates are not too far away by now, and if
> we are confident enough in the direction the patches in this thread
> are going, we should probably consider a deprecation notice soon.

If so, we might want to also update the deprecation warning for the prefix !! operator in pg_operator.dat:

{ oid => '389', descr => 'deprecated, use ! instead',
  oprname => '!!', oprkind => 'l', oprleft => '0', oprright => 'int8',
  oprresult => 'numeric', oprcode => 'numeric_fac' },

That will be the only remaining factorial operator if we remove postfix operators.

—
Mark Dilger
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company






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.