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. -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers