Skip to content

Commit af8c580

Browse files
committed
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
1 parent 65c6cab commit af8c580

6 files changed

+16
-10
lines changed

doc/src/sgml/ref/create_foreign_table.sgml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,8 @@ CHECK ( <replaceable class="parameter">expression</replaceable> ) [ NO INHERIT ]
6969
myschema.mytable ...</literal>) then the table is created in the specified
7070
schema. Otherwise it is created in the current schema.
7171
The name of the foreign table must be
72-
distinct from the name of any other foreign table, table, sequence, index,
73-
view, or materialized view in the same schema.
72+
distinct from the name of any other relation (table, sequence, index, view,
73+
materialized view, or foreign table) in the same schema.
7474
</para>
7575

7676
<para>

doc/src/sgml/ref/create_index.sgml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,10 @@ CREATE [ UNIQUE ] INDEX [ CONCURRENTLY ] [ [ IF NOT EXISTS ] <replaceable class=
202202
<para>
203203
The name of the index to be created. No schema name can be included
204204
here; the index is always created in the same schema as its parent
205-
table. If the name is omitted, <productname>PostgreSQL</productname> chooses a
205+
table. The name of the index must be distinct from the name of any
206+
other relation (table, sequence, index, view, materialized view, or
207+
foreign table) in that schema.
208+
If the name is omitted, <productname>PostgreSQL</productname> chooses a
206209
suitable name based on the parent table's name and the indexed column
207210
name(s).
208211
</para>

doc/src/sgml/ref/create_materialized_view.sgml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,9 @@ CREATE MATERIALIZED VIEW [ IF NOT EXISTS ] <replaceable>table_name</replaceable>
7777
<listitem>
7878
<para>
7979
The name (optionally schema-qualified) of the materialized view to be
80-
created.
80+
created. The name must be distinct from the name of any other relation
81+
(table, sequence, index, view, materialized view, or foreign table) in
82+
the same schema.
8183
</para>
8284
</listitem>
8385
</varlistentry>

doc/src/sgml/ref/create_sequence.sgml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,9 @@ CREATE [ TEMPORARY | TEMP ] SEQUENCE [ IF NOT EXISTS ] <replaceable class="param
4646
specified schema. Otherwise it is created in the current schema.
4747
Temporary sequences exist in a special schema, so a schema name cannot be
4848
given when creating a temporary sequence.
49-
The sequence name must be distinct from the name of any other sequence,
50-
table, index, view, or foreign table in the same schema.
49+
The sequence name must be distinct from the name of any other relation
50+
(table, sequence, index, view, materialized view, or foreign table) in
51+
the same schema.
5152
</para>
5253

5354
<para>

doc/src/sgml/ref/create_table.sgml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,8 @@ WITH ( MODULUS <replaceable class="parameter">numeric_literal</replaceable>, REM
124124
schema. Otherwise it is created in the current schema. Temporary
125125
tables exist in a special schema, so a schema name cannot be given
126126
when creating a temporary table. The name of the table must be
127-
distinct from the name of any other table, sequence, index, view,
128-
or foreign table in the same schema.
127+
distinct from the name of any other relation (table, sequence, index, view,
128+
materialized view, or foreign table) in the same schema.
129129
</para>
130130

131131
<para>

doc/src/sgml/ref/create_view.sgml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ CREATE [ OR REPLACE ] [ TEMP | TEMPORARY ] [ RECURSIVE ] VIEW <replaceable class
5252
schema. Otherwise it is created in the current schema. Temporary
5353
views exist in a special schema, so a schema name cannot be given
5454
when creating a temporary view. The name of the view must be
55-
distinct from the name of any other view, table, sequence, index or foreign table
56-
in the same schema.
55+
distinct from the name of any other relation (table, sequence, index, view,
56+
materialized view, or foreign table) in the same schema.
5757
</para>
5858
</refsect1>
5959

0 commit comments

Comments
 (0)