Doc: be more precise about conflicts between relation names.
authorTom Lane
Tue, 2 Nov 2021 16:12:02 +0000 (12:12 -0400)
committerTom Lane
Tue, 2 Nov 2021 16:12:02 +0000 (12:12 -0400)
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

doc/src/sgml/ref/create_foreign_table.sgml
doc/src/sgml/ref/create_index.sgml
doc/src/sgml/ref/create_materialized_view.sgml
doc/src/sgml/ref/create_sequence.sgml
doc/src/sgml/ref/create_table.sgml
doc/src/sgml/ref/create_view.sgml

index f9477efe58d724b2faa389a6fa8b2e023b58d947..9674670e042f17fa6bee4041d80e670231c3226a 100644 (file)
@@ -69,8 +69,8 @@ CHECK ( expression ) [ NO INHERIT ]
    myschema.mytable ...) 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.
   
 
   
index cc484d5b3980aa30e7df0230f12a40b69ebbd584..89a4d746f6feb414bfd24b6f9bd25adac305a22a 100644 (file)
@@ -202,7 +202,10 @@ CREATE [ UNIQUE ] INDEX [ CONCURRENTLY ] [ [ IF NOT EXISTS ] 
        
         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, PostgreSQL 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, PostgreSQL chooses a
         suitable name based on the parent table's name and the indexed column
         name(s).
        
index d8c48252f49f9356f9d72195fcedae08a3063748..0d2fea2b97f0d613c7a63ccff1980e391099d4f9 100644 (file)
@@ -77,7 +77,9 @@ CREATE MATERIALIZED VIEW [ IF NOT EXISTS ] table_name
     
      
       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.
      
     
    
index e4085804a4d4e57ca31bb95fc75ef767a3f90d9c..20bdbc002fa0890c5483c6d754f1f63fee1e4ab3 100644 (file)
@@ -46,8 +46,9 @@ CREATE [ TEMPORARY | TEMP ] SEQUENCE [ IF NOT EXISTS ] 
    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.
   
 
   
index 473a0a4aebd82dd0b09a0b4cbc5627d412da3d6d..61a584fa34c0318e0c9ab8070183a04976f05d44 100644 (file)
@@ -124,8 +124,8 @@ WITH ( MODULUS numeric_literal, 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.
   
 
   
index 4b5b1cf795318cbef3fe4368f75d8a02bc6f225b..bf032875922ad9febf4cc0376e71a9e6067dc522 100644 (file)
@@ -52,8 +52,8 @@ CREATE [ OR REPLACE ] [ TEMP | TEMPORARY ] [ RECURSIVE ] VIEW 
    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.