BUG #1055: no keys in inherited table with primary key when inserting into inheriting table - Mailing list pgsql-bugs

From PostgreSQL Bugs List
Subject BUG #1055: no keys in inherited table with primary key when inserting into inheriting table
Date
Msg-id 20040120152230.002C5CF4B7F@www.postgresql.com
Whole thread Raw
List pgsql-bugs
The following bug has been logged online:

Bug reference:      1055
Logged by:          Agri

Email address:      agri@desnol.ru

PostgreSQL version: 7.4

Operating system:   PC-linux-gnu

Description:        no keys in inherited table with primary key when
inserting into inheriting table

Details:

let me desribe a bug in the term of sql commands:
create table first (id int primary key );
create table second (f2 int) inherits (first);
create table third (ref_id int);
alter table third add constraint third_ref_first foreign key (ref_id)
references first;
insert into second (id, f2) values (1, 1);

and at last a bug insert:
insert into third (ref_id) values (1);
results in:
ERROR:  insert or update on table "third" violates foreign key constraint
"third_ref_first"

if i get a select:
select * from first;
 id
----
  1
(1 row)

bug is: values are not added into primary key of the inherited table when
records are inserted into the inheriting table

pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: unique index problems
Next
From: "PostgreSQL Bugs List"
Date:
Subject: BUG #1056: ecpg ignores WHENEVER NOT FOUND