Skip site navigation (1) Skip section navigation (2)

BUG #1195: foreignkey-bug

From: "PostgreSQL Bugs List" <pgsql-bugs(at)postgresql(dot)org>
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #1195: foreignkey-bug
Date: 2004-07-18 14:12:07
Message-ID: 20040718141207.DDCAECF4B0D@www.postgresql.com (view raw or flat)
Thread:
Lists: pgsql-bugs
The following bug has been logged online:

Bug reference:      1195
Logged by:          Michael Groth

Email address:      m(dot)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


Responses

pgsql-bugs by date

Next:From: Peter EisentrautDate: 2004-07-18 15:40:45
Subject: Re: BUG #1195: foreignkey-bug
Previous:From: Tom LaneDate: 2004-07-17 17:30:51
Subject: Re: Problems renaming referencing column

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group