dbTalk Databases Forums  

[BUGS] BUG #1146: REFERENCES doesn't work on Inherited Tables

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


Discuss [BUGS] BUG #1146: REFERENCES doesn't work on Inherited Tables in the mailing.database.pgsql-bugs forum.



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

Default [BUGS] BUG #1146: REFERENCES doesn't work on Inherited Tables - 05-06-2004 , 06:53 AM







The following bug has been logged online:

Bug reference: 1146
Logged by: Gábor Katona

Email address: katonag (AT) dragon (DOT) klte.hu

PostgreSQL version: 7.3.4

Operating system: Cygwin

Description: REFERENCES doesn't work on Inherited Tables

Details:

The inserting of a row into a table doesn't reflect in the mother table
when the mother table is referenced from a third one.

Example
'a' is the mother table, 'b' is the child, and there is a reference to 'a'
in table 'c'

create table a( id INT UNIQUE, name VARCHAR);
create table b( foofoo INT) INHERITS(a);
create table c (id INT UNIQUE, bar INT, foo INT REFERENCES "a"("id"));

insert into b VALUES (1,'first',0);
insert into b VALUES (2,'second',3);

Then inserting into 'c'

insert into c values (1,3,2);

and the result is unfortunately:
$1 referential integrity violation - key referenced from c not found in a

which means, that id=2 is not in table 'a'.



---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
joining column's datatypes do not match

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.