Skip to content

Commit 1973d9f

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 a0e0fb1 commit 1973d9f

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
@@ -143,7 +143,7 @@ WITH ( MODULUS <replaceable class="parameter">numeric_literal</replaceable>, REM
143143

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

146-
{ <replaceable class="parameter">column_name</replaceable> | ( <replaceable class="parameter">expression</replaceable> ) } [ <replaceable class="parameter">opclass</replaceable> ] [ ASC | DESC ] [ NULLS { FIRST | LAST } ]
146+
{ <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 } ]
147147

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

doc/src/sgml/ref/create_table.sgml

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

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

108-
{ <replaceable class="parameter">column_name</replaceable> | ( <replaceable class="parameter">expression</replaceable> ) } [ <replaceable class="parameter">opclass</replaceable> ] [ ASC | DESC ] [ NULLS { FIRST | LAST } ]
108+
{ <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 } ]
109109

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

@@ -1116,6 +1116,7 @@ WITH ( MODULUS <replaceable class="parameter">numeric_literal</replaceable>, REM
11161116
no two rows in the table contain overlapping circles
11171117
(see <xref linkend="datatype-geometric"/>) by using the
11181118
<literal>&amp;&amp;</literal> operator.
1119+
The operator(s) are required to be commutative.
11191120
</para>
11201121

11211122
<para>
@@ -1124,11 +1125,10 @@ WITH ( MODULUS <replaceable class="parameter">numeric_literal</replaceable>, REM
11241125
operator must be associated with an appropriate operator class
11251126
(see <xref linkend="indexes-opclass"/>) for the index access
11261127
method <replaceable>index_method</replaceable>.
1127-
The operators are required to be commutative.
11281128
Each <replaceable class="parameter">exclude_element</replaceable>
1129-
can optionally specify an operator class and/or ordering options;
1130-
these are described fully under
1131-
<xref linkend="sql-createindex"/>.
1129+
defines a column of the index, so it can optionally specify a collation,
1130+
an operator class, operator class parameters, and/or ordering options;
1131+
these are described fully under <xref linkend="sql-createindex"/>.
11321132
</para>
11331133

11341134
<para>

0 commit comments

Comments
 (0)