[BUG?] table inhiritance violates primary key

Поиск
Список
Период
Сортировка
От Sven Köhler
Тема [BUG?] table inhiritance violates primary key
Дата
Msg-id bdbo87$nm8$1@main.gmane.org
обсуждение исходный текст
Ответы Re: [BUG?] table inhiritance violates primary key  (Sven Köhler <skoehler@upb.de>)
Re: [BUG?] table inhiritance violates primary key  (Stephan Szabo <sszabo@megazone23.bigpanda.com>)
Список pgsql-general
hi,

i have two tables:
CREATE TABLE public.test1 (
   id1 int4 NOT NULL,
   CONSTRAINT test1_pkey PRIMARY KEY (id1)
) WITHOUT OIDS;
CREATE TABLE public.test3 (
) INHERITS(test1) WITH OIDS;


i can insert the values
1
1
1

into the table test2. when i do a select * from test1 it returns:
1
1
1

after that i can once insert the value 1 again directly into table
test1. a second try failes for table test1.

it would make more sense, if the table test2 inhirits the primary key of
table test1 because each value inserted into test2 creates an implicit
entry in table test1 (at least from the users point of view) and these
entries simply violate the primary key of test1 which is unique.

so what's the deal with table inhiritance? i guess other constraints
aren't inhirited too - what about foreign keys, unique indexes etc.?


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

Предыдущее
От: Hubert Lubaczewski
Дата:
Сообщение: Re: Updating an emty table?
Следующее
От: "Bjorn T Johansen"
Дата:
Сообщение: Re: Updating an emty table?