dbTalk Databases Forums  

[BUGS] BUG #1195: foreignkey-bug

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


Discuss [BUGS] BUG #1195: foreignkey-bug in the mailing.database.pgsql-bugs forum.



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

Default [BUGS] BUG #1195: foreignkey-bug - 07-18-2004 , 09:21 AM







The following bug has been logged online:

Bug reference: 1195
Logged by: Michael Groth

Email address: m.groth (AT) 10grad (DOT) de

PostgreSQL version: 7.4

Operating system: debian

Description: foreignkey-bug

Details:

hello,

this constraint doesn't work correctly : 'FOREIGN KEY (id_1, id_2)
REFERENCES table_1 ON DELETE CASCADE'
adding records into table_2 the database sometimes said that there is no
corresponding record in table_1, but there is.

otherwise this constraint work correctly with the same list of records:
'FOREIGN KEY (id_1, id_2) REFERENCES table_1 (id_1, id_2) ON DELETE CASCADE'



table-structure:


CREATE TABLE table_1 (
id_1 int NOT NULL,
id_2 int NOT NULL,
PRIMARY KEY (id_1, id_2)
);



CREATE TABLE table_2 (
id_1 int NOT NULL,
id_2 int NOT NULL,
FOREIGN KEY (id_1, id_2) REFERENCES table_1 ON DELETE CASCADE
);



best regards

michael


---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings

Reply With Quote
  #2  
Old   
Peter Eisentraut
 
Posts: n/a

Default Re: [BUGS] BUG #1195: foreignkey-bug - 07-18-2004 , 10:57 AM






PostgreSQL Bugs List wrote:
Quote:
this constraint doesn't work correctly : 'FOREIGN KEY (id_1, id_2)
REFERENCES table_1 ON DELETE CASCADE'
adding records into table_2 the database sometimes said that there is
no corresponding record in table_1, but there is.
Please provide a concrete, reproducible example.

--
Peter Eisentraut
http://developer.postgresql.org/~petere/


---------------------------(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.