dbTalk Databases Forums  

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

mailing.database.pgsql-bugs mailing.database.pgsql-bugs


Discuss [BUGS] BUG #1055: no keys in inherited table with primary key when inserting into inheriting table in the mailing.database.pgsql-bugs forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
PostgreSQL Bugs List
 
Posts: n/a

Default [BUGS] BUG #1055: no keys in inherited table with primary key when inserting into inheriting table - 01-20-2004 , 09:33 AM







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


---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.