diff options
author | Tom Lane | 2021-11-02 16:12:02 +0000 |
---|---|---|
committer | Tom Lane | 2021-11-02 16:12:02 +0000 |
commit | af8c580e5cf32bb85dde70083a260c93a1f783eb (patch) | |
tree | 87dc7c38d5b080f32d312b390b9282a232a45b81 | |
parent | 65c6cab1365ac33b11a49a2a193f6b3f9c53e487 (diff) |
Doc: be more precise about conflicts between relation names.
Use verbiage like "The name of the table must be distinct from the name
of any other relation (table, sequence, index, view, materialized view,
or foreign table) in the same schema." in the reference pages for all
those object types. The main change here is to mention materialized
views explicitly; although a couple of these pages failed to say
anything at all about name conflicts.
Per suggestion from Daniel Westermann.
Discussion: https://postgr.es/m/ZR0P278MB0920D0946509233459AF0DEFD2889@ZR0P278MB0920.CHEP278.PROD.OUTLOOK.COM
-rw-r--r-- | doc/src/sgml/ref/create_foreign_table.sgml | 4 | ||||
-rw-r--r-- | doc/src/sgml/ref/create_index.sgml | 5 | ||||
-rw-r--r-- | doc/src/sgml/ref/create_materialized_view.sgml | 4 | ||||
-rw-r--r-- | doc/src/sgml/ref/create_sequence.sgml | 5 | ||||
-rw-r--r-- | doc/src/sgml/ref/create_table.sgml | 4 | ||||
-rw-r--r-- | doc/src/sgml/ref/create_view.sgml | 4 |
6 files changed, 16 insertions, 10 deletions
diff --git a/doc/src/sgml/ref/create_foreign_table.sgml b/doc/src/sgml/ref/create_foreign_table.sgml index f9477efe58d..9674670e042 100644 --- a/doc/src/sgml/ref/create_foreign_table.sgml +++ b/doc/src/sgml/ref/create_foreign_table.sgml @@ -69,8 +69,8 @@ CHECK ( <replaceable class="parameter">expression</replaceable> ) [ NO INHERIT ] myschema.mytable ...</literal>) then the table is created in the specified schema. Otherwise it is created in the current schema. The name of the foreign table must be - distinct from the name of any other foreign table, table, sequence, index, - view, or materialized view in the same schema. + distinct from the name of any other relation (table, sequence, index, view, + materialized view, or foreign table) in the same schema. </para> <para> diff --git a/doc/src/sgml/ref/create_index.sgml b/doc/src/sgml/ref/create_index.sgml index cc484d5b398..89a4d746f6f 100644 --- a/doc/src/sgml/ref/create_index.sgml +++ b/doc/src/sgml/ref/create_index.sgml @@ -202,7 +202,10 @@ CREATE [ UNIQUE ] INDEX [ CONCURRENTLY ] [ [ IF NOT EXISTS ] <replaceable class= <para> The name of the index to be created. No schema name can be included here; the index is always created in the same schema as its parent - table. If the name is omitted, <productname>PostgreSQL</productname> chooses a + table. The name of the index must be distinct from the name of any + other relation (table, sequence, index, view, materialized view, or + foreign table) in that schema. + If the name is omitted, <productname>PostgreSQL</productname> chooses a suitable name based on the parent table's name and the indexed column name(s). </para> diff --git a/doc/src/sgml/ref/create_materialized_view.sgml b/doc/src/sgml/ref/create_materialized_view.sgml index d8c48252f49..0d2fea2b97f 100644 --- a/doc/src/sgml/ref/create_materialized_view.sgml +++ b/doc/src/sgml/ref/create_materialized_view.sgml @@ -77,7 +77,9 @@ CREATE MATERIALIZED VIEW [ IF NOT EXISTS ] <replaceable>table_name</replaceable> <listitem> <para> The name (optionally schema-qualified) of the materialized view to be - created. + created. The name must be distinct from the name of any other relation + (table, sequence, index, view, materialized view, or foreign table) in + the same schema. </para> </listitem> </varlistentry> diff --git a/doc/src/sgml/ref/create_sequence.sgml b/doc/src/sgml/ref/create_sequence.sgml index e4085804a4d..20bdbc002fa 100644 --- a/doc/src/sgml/ref/create_sequence.sgml +++ b/doc/src/sgml/ref/create_sequence.sgml @@ -46,8 +46,9 @@ CREATE [ TEMPORARY | TEMP ] SEQUENCE [ IF NOT EXISTS ] <replaceable class="param specified schema. Otherwise it is created in the current schema. Temporary sequences exist in a special schema, so a schema name cannot be given when creating a temporary sequence. - The sequence name must be distinct from the name of any other sequence, - table, index, view, or foreign table in the same schema. + The sequence name must be distinct from the name of any other relation + (table, sequence, index, view, materialized view, or foreign table) in + the same schema. </para> <para> diff --git a/doc/src/sgml/ref/create_table.sgml b/doc/src/sgml/ref/create_table.sgml index 473a0a4aebd..61a584fa34c 100644 --- a/doc/src/sgml/ref/create_table.sgml +++ b/doc/src/sgml/ref/create_table.sgml @@ -124,8 +124,8 @@ WITH ( MODULUS <replaceable class="parameter">numeric_literal</replaceable>, REM schema. Otherwise it is created in the current schema. Temporary tables exist in a special schema, so a schema name cannot be given when creating a temporary table. The name of the table must be - distinct from the name of any other table, sequence, index, view, - or foreign table in the same schema. + distinct from the name of any other relation (table, sequence, index, view, + materialized view, or foreign table) in the same schema. </para> <para> diff --git a/doc/src/sgml/ref/create_view.sgml b/doc/src/sgml/ref/create_view.sgml index 4b5b1cf7953..bf032875922 100644 --- a/doc/src/sgml/ref/create_view.sgml +++ b/doc/src/sgml/ref/create_view.sgml @@ -52,8 +52,8 @@ CREATE [ OR REPLACE ] [ TEMP | TEMPORARY ] [ RECURSIVE ] VIEW <replaceable class schema. Otherwise it is created in the current schema. Temporary views exist in a special schema, so a schema name cannot be given when creating a temporary view. The name of the view must be - distinct from the name of any other view, table, sequence, index or foreign table - in the same schema. + distinct from the name of any other relation (table, sequence, index, view, + materialized view, or foreign table) in the same schema. </para> </refsect1> |