From a690920015bddc9c20f93d1a828c53ac3c21e489 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Sun, 7 Apr 2024 15:36:08 -0400 Subject: [PATCH] Doc: update documentation about EXCLUDE constraint elements. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 --- doc/src/sgml/ref/alter_table.sgml | 2 +- doc/src/sgml/ref/create_table.sgml | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/doc/src/sgml/ref/alter_table.sgml b/doc/src/sgml/ref/alter_table.sgml index d4d93eeb7c..24316bb816 100644 --- a/doc/src/sgml/ref/alter_table.sgml +++ b/doc/src/sgml/ref/alter_table.sgml @@ -134,7 +134,7 @@ WITH ( MODULUS numeric_literal, REM exclude_element in an EXCLUDE constraint is: -{ column_name | ( expression ) } [ opclass ] [ ASC | DESC ] [ NULLS { FIRST | LAST } ] +{ column_name | ( expression ) } [ COLLATE collation ] [ opclass [ ( opclass_parameter = value [, ... ] ) ] ] [ ASC | DESC ] [ NULLS { FIRST | LAST } ] referential_action in a FOREIGN KEY/REFERENCES constraint is: diff --git a/doc/src/sgml/ref/create_table.sgml b/doc/src/sgml/ref/create_table.sgml index 6a15676d88..1ab6f76786 100644 --- a/doc/src/sgml/ref/create_table.sgml +++ b/doc/src/sgml/ref/create_table.sgml @@ -104,7 +104,7 @@ WITH ( MODULUS numeric_literal, REM exclude_element in an EXCLUDE constraint is: -{ column_name | ( expression ) } [ opclass ] [ ASC | DESC ] [ NULLS { FIRST | LAST } ] +{ column_name | ( expression ) } [ COLLATE collation ] [ opclass [ ( opclass_parameter = value [, ... ] ) ] ] [ ASC | DESC ] [ NULLS { FIRST | LAST } ] referential_action in a FOREIGN KEY/REFERENCES constraint is: @@ -1086,6 +1086,7 @@ WITH ( MODULUS numeric_literal, REM no two rows in the table contain overlapping circles (see ) by using the && operator. + The operator(s) are required to be commutative. @@ -1094,11 +1095,10 @@ WITH ( MODULUS numeric_literal, REM appropriate operator class (see ) for the index access method index_method. - The operators are required to be commutative. Each exclude_element - can optionally specify an operator class and/or ordering options; - these are described fully under - . + defines a column of the index, so it can optionally specify a collation, + an operator class, operator class parameters, and/or ordering options; + these are described fully under . -- 2.11.4.GIT