factorial function/phase out postfix operators?

From: Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>
To: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: factorial function/phase out postfix operators?
Date: 2020-05-18 14:42:18
Message-ID: 38ca86db-42ab-9b48-2902-337a0d6b8311@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

There have been occasional discussions about deprecating or phasing out
postfix operators, to make various things easier in the parser.

The first step would in any case be to provide alternatives for the
existing postfix operators. There is currently one, namely the numeric
factorial operator "!". A sensible alternative for that would be
providing a function factorial(numeric) -- and that already exists but
is not documented. (Note that the operator is mapped to proname
"numeric_fac". The function "factorial" maps to the same prosrc but is
otherwise independent of the operator.)

So I suggest that we add that function to the documentation.

(Some adjacent cleanup work might also be in order. The test cases for
factorial are currently in int4.sql, but all the factorial functionality
was moved to numeric a long time ago.)

What are the thoughts about then marking the postfix operator deprecated
and eventually removing it?

--
Peter Eisentraut http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2020-05-18 14:54:06 Re: fill_extraUpdatedCols is done in completely the wrong place
Previous Message Vik Fearing 2020-05-18 14:41:23 Missing grammar production for WITH TIES