Be more clear what names can be used for tables with "CREATE TABLE"?

Поиск
Список
Период
Сортировка
От Daniel Westermann (DWE)
Тема Be more clear what names can be used for tables with "CREATE TABLE"?
Дата
Msg-id ZR0P278MB0920D0946509233459AF0DEFD2889@ZR0P278MB0920.CHEP278.PROD.OUTLOOK.COM
обсуждение исходный текст
Ответы 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>)
Список 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 по дате отправления:

Предыдущее
От: Daniel Gustafsson
Дата:
Сообщение: Re: broken link to "SELinux guide" from sepgsql
Следующее
От: Jürgen Purtz
Дата:
Сообщение: Re: Be more clear what names can be used for tables with "CREATE TABLE"?