1
0
mirror of https://github.com/postgres/postgres.git synced 2025-12-21 05:21:08 +03:00

Change PROCEDURE to FUNCTION in CREATE OPERATOR syntax

Since procedures are now a different thing from functions, change the
CREATE OPERATOR syntax to use FUNCTION in the clause that specifies the
function.  PROCEDURE is still accepted for compatibility.

Reported-by: Peter Geoghegan <pg@bowt.ie>
Reviewed-by: Jonathan S. Katz <jonathan.katz@excoventures.com>
This commit is contained in:
Peter Eisentraut
2018-08-15 18:05:46 +02:00
parent b19495772e
commit d12782898e
7 changed files with 30 additions and 18 deletions

View File

@@ -22,7 +22,7 @@ PostgreSQL documentation
<refsynopsisdiv>
<synopsis>
CREATE OPERATOR <replaceable>name</replaceable> (
PROCEDURE = <replaceable class="parameter">function_name</replaceable>
{FUNCTION|PROCEDURE} = <replaceable class="parameter">function_name</replaceable>
[, LEFTARG = <replaceable class="parameter">left_type</replaceable> ] [, RIGHTARG = <replaceable class="parameter">right_type</replaceable> ]
[, COMMUTATOR = <replaceable class="parameter">com_op</replaceable> ] [, NEGATOR = <replaceable class="parameter">neg_op</replaceable> ]
[, RESTRICT = <replaceable class="parameter">res_proc</replaceable> ] [, JOIN = <replaceable class="parameter">join_proc</replaceable> ]
@@ -99,6 +99,14 @@ CREATE OPERATOR <replaceable>name</replaceable> (
of arguments (either one or two) of the indicated types.
</para>
<para>
In the syntax of <literal>CREATE OPERATOR</literal>, the keywords
<literal>FUNCTION</literal> and <literal>PROCEDURE</literal> are
equivalent, but the referenced function must in any case be a function, not
a procedure. The use of the keyword <literal>PROCEDURE</literal> here is
historical and deprecated.
</para>
<para>
The other clauses specify optional operator optimization clauses.
Their meaning is detailed in <xref linkend="xoper-optimization"/>.
@@ -264,7 +272,7 @@ COMMUTATOR = OPERATOR(myschema.===) ,
CREATE OPERATOR === (
LEFTARG = box,
RIGHTARG = box,
PROCEDURE = area_equal_function,
FUNCTION = area_equal_function,
COMMUTATOR = ===,
NEGATOR = !==,
RESTRICT = area_restriction_function,