Skip to content

Commit cc8a71e

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 fabd2f9 commit cc8a71e

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
@@ -524,14 +524,16 @@
524524

525525
<row>
526526
<entry> <literal>!</literal> </entry>
527-
<entry>factorial</entry>
527+
<entry>factorial
528+
(deprecated, use <function>factorial()</function> instead)</entry>
528529
<entry><literal>5 !</literal></entry>
529530
<entry><literal>120</literal></entry>
530531
</row>
531532

532533
<row>
533534
<entry> <literal>!!</literal> </entry>
534-
<entry>factorial (prefix operator)</entry>
535+
<entry>factorial as a prefix operator
536+
(deprecated, use <function>factorial()</function> instead)</entry>
535537
<entry><literal>!! 5</literal></entry>
536538
<entry><literal>120</literal></entry>
537539
</row>
@@ -714,6 +716,19 @@
714716
<entry><literal>2.71828182845905</literal></entry>
715717
</row>
716718

719+
<row>
720+
<entry>
721+
<indexterm>
722+
<primary>factorial</primary>
723+
</indexterm>
724+
<literal><function>factorial(<type>bigint</type>)</function></literal>
725+
</entry>
726+
<entry><type>numeric</type></entry>
727+
<entry>factorial</entry>
728+
<entry><literal>factorial(5)</literal></entry>
729+
<entry><literal>120</literal></entry>
730+
</row>
731+
717732
<row>
718733
<entry>
719734
<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</> and <literal>RIGHTARG</> 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</> should be defined, while for left
9292
unary operators only <literal>RIGHTARG</> 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
procedure must have been previously defined using <command>CREATE

0 commit comments

Comments
 (0)