Re: factorial function/phase out postfix operators?

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Vik Fearing <vik(at)postgresfriends(dot)org>
Cc: Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: factorial function/phase out postfix operators?
Date: 2020-05-18 15:39:34
Message-ID: 20200518153934.GA31868@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, May 18, 2020 at 05:02:34PM +0200, Vik Fearing wrote:
> On 5/18/20 4:42 PM, Peter Eisentraut wrote:
> > 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.
>
> I think this should be done regardless.
>
> > (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?
>
> I am greatly in favor of removing postfix operators as soon as possible.

Agreed.

--
Bruce Momjian <bruce(at)momjian(dot)us> https://momjian.us
EnterpriseDB https://enterprisedb.com

+ As you are, so once was I. As I am, so you will be. +
+ Ancient Roman grave inscription +

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Jürgen Purtz 2020-05-18 16:08:01 Re: Add A Glossary
Previous Message Pavel Stehule 2020-05-18 15:33:07 proposal - plpgsql - FOR over unbound cursor