Skip to content

Commit a690920

Browse files
committed
Doc: update documentation about EXCLUDE constraint elements.
What the documentation calls an exclude_element is an index_elem according to gram.y, and it allows all the same options that a CREATE INDEX column specification does. The COLLATE patch neglected to update the CREATE/ALTER TABLE docs about that, and later the opclass-parameters patch made the same oversight. Add those options to the syntax synopses, and polish the associated text a bit. Back-patch to v13 where opclass parameters came in. We could update v12 with just the COLLATE omission, but it doesn't quite seem worth the trouble at this point. Shihao Zhong, reviewed by Daniel Vérité, Shubham Khanna and myself Discussion: https://postgr.es/m/CAGRkXqShbVyB8E3gapfdtuwiWTiK=Q67Qb9qwxu=+-w0w46EBA@mail.gmail.com
1 parent dfe402f commit a690920

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

doc/src/sgml/ref/alter_table.sgml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ WITH ( MODULUS <replaceable class="parameter">numeric_literal</replaceable>, REM
134134

135135
<phrase><replaceable class="parameter">exclude_element</replaceable> in an <literal>EXCLUDE</literal> constraint is:</phrase>
136136

137-
{ <replaceable class="parameter">column_name</replaceable> | ( <replaceable class="parameter">expression</replaceable> ) } [ <replaceable class="parameter">opclass</replaceable> ] [ ASC | DESC ] [ NULLS { FIRST | LAST } ]
137+
{ <replaceable class="parameter">column_name</replaceable> | ( <replaceable class="parameter">expression</replaceable> ) } [ COLLATE <replaceable class="parameter">collation</replaceable> ] [ <replaceable class="parameter">opclass</replaceable> [ ( <replaceable class="parameter">opclass_parameter</replaceable> = <replaceable class="parameter">value</replaceable> [, ... ] ) ] ] [ ASC | DESC ] [ NULLS { FIRST | LAST } ]
138138

139139
<phrase><replaceable class="parameter">referential_action</replaceable> in a <literal>FOREIGN KEY</literal>/<literal>REFERENCES</literal> constraint is:</phrase>
140140

doc/src/sgml/ref/create_table.sgml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ WITH ( MODULUS <replaceable class="parameter">numeric_literal</replaceable>, REM
104104

105105
<phrase><replaceable class="parameter">exclude_element</replaceable> in an <literal>EXCLUDE</literal> constraint is:</phrase>
106106

107-
{ <replaceable class="parameter">column_name</replaceable> | ( <replaceable class="parameter">expression</replaceable> ) } [ <replaceable class="parameter">opclass</replaceable> ] [ ASC | DESC ] [ NULLS { FIRST | LAST } ]
107+
{ <replaceable class="parameter">column_name</replaceable> | ( <replaceable class="parameter">expression</replaceable> ) } [ COLLATE <replaceable class="parameter">collation</replaceable> ] [ <replaceable class="parameter">opclass</replaceable> [ ( <replaceable class="parameter">opclass_parameter</replaceable> = <replaceable class="parameter">value</replaceable> [, ... ] ) ] ] [ ASC | DESC ] [ NULLS { FIRST | LAST } ]
108108

109109
<phrase><replaceable class="parameter">referential_action</replaceable> in a <literal>FOREIGN KEY</literal>/<literal>REFERENCES</literal> constraint is:</phrase>
110110

@@ -1086,6 +1086,7 @@ WITH ( MODULUS <replaceable class="parameter">numeric_literal</replaceable>, REM
10861086
no two rows in the table contain overlapping circles
10871087
(see <xref linkend="datatype-geometric"/>) by using the
10881088
<literal>&amp;&amp;</literal> operator.
1089+
The operator(s) are required to be commutative.
10891090
</para>
10901091

10911092
<para>
@@ -1094,11 +1095,10 @@ WITH ( MODULUS <replaceable class="parameter">numeric_literal</replaceable>, REM
10941095
appropriate operator class
10951096
(see <xref linkend="indexes-opclass"/>) for the index access
10961097
method <replaceable>index_method</replaceable>.
1097-
The operators are required to be commutative.
10981098
Each <replaceable class="parameter">exclude_element</replaceable>
1099-
can optionally specify an operator class and/or ordering options;
1100-
these are described fully under
1101-
<xref linkend="sql-createindex"/>.
1099+
defines a column of the index, so it can optionally specify a collation,
1100+
an operator class, operator class parameters, and/or ordering options;
1101+
these are described fully under <xref linkend="sql-createindex"/>.
11021102
</para>
11031103

11041104
<para>

0 commit comments

Comments
 (0)