BUG #1055: no keys in inherited table with primary key when inserting into inheriting table

From: "PostgreSQL Bugs List" <pgsql-bugs(at)postgresql(dot)org>
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #1055: no keys in inherited table with primary key when inserting into inheriting table
Date: 2004-01-20 15:22:30
Message-ID: 20040120152230.002C5CF4B7F@www.postgresql.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs


The following bug has been logged online:

Bug reference: 1055
Logged by: Agri

Email address: agri(at)desnol(dot)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

Browse pgsql-bugs by date

  From Date Subject
Next Message PostgreSQL Bugs List 2004-01-20 20:44:30 BUG #1056: ecpg ignores WHENEVER NOT FOUND
Previous Message Tom Lane 2004-01-19 06:18:02 Re: unique index problems