Be more clear what names can be used for tables with "CREATE TABLE"? - Mailing list pgsql-docs

From Daniel Westermann (DWE)
Subject Be more clear what names can be used for tables with "CREATE TABLE"?
Date
Msg-id ZR0P278MB0920D0946509233459AF0DEFD2889@ZR0P278MB0920.CHEP278.PROD.OUTLOOK.COM
Whole thread Raw
Responses Re: Be more clear what names can be used for tables with "CREATE TABLE"?  (Jürgen Purtz <juergen@purtz.de>)
Re: Be more clear what names can be used for tables with "CREATE TABLE"?  (Laurenz Albe <laurenz.albe@cybertec.at>)
List pgsql-docs
HI all,

in the documentation for CREATE TABLE we have this sentence:

"The name of the table must be distinct from the name of any other table, sequence, index, view, or foreign table in
thesame schema." 

At least materialized views are missing:

postgres=# create materialized view t as select 1;
SELECT 1
postgres=# create table t ( a int );
ERROR:  relation "t" already exists
postgres=# drop materialized view t;
DROP MATERIALIZED VIEW

Domains are also missing:

postgres=# create domain t as int;
CREATE DOMAIN
postgres=# create table t ( a int );
ERROR:  type "t" already exists
HINT:  A relation has an associated type of the same name, so you must use a name that doesn't conflict with any
existingtype. 
postgres=# drop domain t;
DROP DOMAIN

... but that maybe is covered by the next paragraph?

"CREATE TABLE also automatically creates a data type that represents the composite type corresponding to one row of the
table.Therefore, tables cannot have the same name as any existing data type in the same schema." 

Regards
Daniel


pgsql-docs by date:

Previous
From: Daniel Gustafsson
Date:
Subject: Re: broken link to "SELinux guide" from sepgsql
Next
From: Jürgen Purtz
Date:
Subject: Re: Be more clear what names can be used for tables with "CREATE TABLE"?