Skip to content

Commit 9dee85b

Browse files
committed
Mark factorial operator, and postfix operators in general, as deprecated.
Back-patch key parts of 4c5cf54 and 6ca547c into stable branches. I didn't touch pg_description entries here, so it's purely a docs change; and I didn't fool with any examples either. The main point is so that anyone who's wondering if factorial() exists in the stable branches will be reassured. Mark Dilger and John Naylor, with some adjustments by me Discussion: https://postgr.es/m/BE2DF53D-251A-4E26-972F-930E523580E9@enterprisedb.com
1 parent ff3c16d commit 9dee85b

File tree

2 files changed

+25
-3
lines changed

2 files changed

+25
-3
lines changed

doc/src/sgml/func.sgml

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -666,14 +666,16 @@
666666

667667
<row>
668668
<entry> <literal>!</literal> </entry>
669-
<entry>factorial</entry>
669+
<entry>factorial
670+
(deprecated, use <function>factorial()</function> instead)</entry>
670671
<entry><literal>5 !</literal></entry>
671672
<entry><literal>120</literal></entry>
672673
</row>
673674

674675
<row>
675676
<entry> <literal>!!</literal> </entry>
676-
<entry>factorial (prefix operator)</entry>
677+
<entry>factorial as a prefix operator
678+
(deprecated, use <function>factorial()</function> instead)</entry>
677679
<entry><literal>!! 5</literal></entry>
678680
<entry><literal>120</literal></entry>
679681
</row>
@@ -856,6 +858,19 @@
856858
<entry><literal>2.71828182845905</literal></entry>
857859
</row>
858860

861+
<row>
862+
<entry>
863+
<indexterm>
864+
<primary>factorial</primary>
865+
</indexterm>
866+
<literal><function>factorial(<type>bigint</type>)</function></literal>
867+
</entry>
868+
<entry><type>numeric</type></entry>
869+
<entry>factorial</entry>
870+
<entry><literal>factorial(5)</literal></entry>
871+
<entry><literal>120</literal></entry>
872+
</row>
873+
859874
<row>
860875
<entry>
861876
<indexterm>

doc/src/sgml/ref/create_operator.sgml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,11 +87,18 @@ CREATE OPERATOR <replaceable>name</replaceable> (
8787

8888
<para>
8989
At least one of <literal>LEFTARG</literal> and <literal>RIGHTARG</literal> must be defined. For
90-
binary operators, both must be defined. For right unary
90+
binary operators, both must be defined. For right unary
9191
operators, only <literal>LEFTARG</literal> should be defined, while for left
9292
unary operators only <literal>RIGHTARG</literal> should be defined.
9393
</para>
9494

95+
<note>
96+
<para>
97+
Right unary, also called postfix, operators are deprecated and will be
98+
removed in <productname>PostgreSQL</productname> version 14.
99+
</para>
100+
</note>
101+
95102
<para>
96103
The <replaceable class="parameter">function_name</replaceable>
97104
function must have been previously defined using <command>CREATE

0 commit comments

Comments
 (0)