[BUG?] table inhiritance violates primary key - Mailing list pgsql-general

From Sven Köhler
Subject [BUG?] table inhiritance violates primary key
Date
Msg-id bdbo87$nm8$1@main.gmane.org
Whole thread Raw
Responses 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>)
List 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 by date:

Previous
From: Hubert Lubaczewski
Date:
Subject: Re: Updating an emty table?
Next
From: "Bjorn T Johansen"
Date:
Subject: Re: Updating an emty table?