Re: factorial function/phase out postfix operators?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: John Naylor <john(dot)naylor(at)2ndquadrant(dot)com>, Mark Dilger <mark(dot)dilger(at)enterprisedb(dot)com>, Vik Fearing <vik(at)postgresfriends(dot)org>, 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-08-27 14:04:04
Message-ID: 3029388.1598537044@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Robert Haas <robertmhaas(at)gmail(dot)com> writes:
> Yeah, that looks like a good spot. I think we should also add
> something to the documentation of the factorial operator, mentioning
> that it will be going away. Perhaps we can advise people to write !!3
> instead of 3! for forward-compatibility, or maybe we should instead
> suggest numeric_fac(3).

Well, the !! operator itself has been "deprecated" for a long time:

regression=# \do+ !!
List of operators
Schema | Name | Left arg type | Right arg type | Result type | Function | Description
------------+------+---------------+----------------+-------------+-------------+---------------------------
pg_catalog | !! | | bigint | numeric | numeric_fac | deprecated, use ! instead
pg_catalog | !! | | tsquery | tsquery | tsquery_not | NOT tsquery
(2 rows)

I'm a bit inclined to kill them both off and standardize on factorial()
(not numeric_fac).

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Mark Dilger 2020-08-27 14:14:26 Re: factorial function/phase out postfix operators?
Previous Message Robert Haas 2020-08-27 13:56:47 Re: Support for OUT parameters in procedures