Re: CREATE LIKE INCLUDING COMMENTS and STORAGES

Поиск
Список
Период
Сортировка
От Khee Chin
Тема Re: CREATE LIKE INCLUDING COMMENTS and STORAGES
Дата
Msg-id 797115b80910040710h4fa53a89s1eba12e391988cdd@mail.gmail.com
обсуждение исходный текст
Ответ на Re: CREATE LIKE INCLUDING COMMENTS and STORAGES  (Andrew Dunstan <andrew@dunslane.net>)
Ответы Re: CREATE LIKE INCLUDING COMMENTS and STORAGES  (Itagaki Takahiro <itagaki.takahiro@oss.ntt.co.jp>)
Список pgsql-hackers
Recently, I encountered a situation where the docs on (or impl?)
INCLUDING INDEXES and INCLUDING CONSTRAINTS are not clearly defined
for primary keys. Should it be noted in the docs that in this case, we
are referring to the technical implementation of a primary key, i.e. a
unique index and a not null constraint, thus both conditions are
required?

testdb=> CREATE TABLE foo (id int primary key);
NOTICE:  CREATE TABLE / PRIMARY KEY will create implicit index
"foo_pkey" for table "foo"
CREATE TABLE
testdb=> \d foo;     Table "public.foo"Column |  Type   | Modifiers
--------+---------+-----------id     | integer | not null
Indexes:   "foo_pkey" PRIMARY KEY, btree (id)

testdb=> CREATE TABLE foo2 (LIKE FOO INCLUDING CONSTRAINTS EXCLUDING INDEXES);
CREATE TABLE
testdb=> \d foo2    Table "public.foo2"Column |  Type   | Modifiers
--------+---------+-----------id     | integer | not null

testdb=> CREATE TABLE foo3 (LIKE FOO EXCLUDING CONSTRAINTS INCLUDING INDEXES);
NOTICE:  CREATE TABLE / PRIMARY KEY will create implicit index
"foo3_pkey" for table "foo3"
CREATE TABLE
testdb=> \d foo3;    Table "public.foo3"Column |  Type   | Modifiers
--------+---------+-----------id     | integer | not null
Indexes:   "foo3_pkey" PRIMARY KEY, btree (id)

testdb=>


Regards,
Khee Chin.


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Marko Tiikkaja
Дата:
Сообщение: Re: Using results from INSERT ... RETURNING
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Getting the red out (of the buildfarm)