dbTalk Databases Forums  

Re: [BUGS] BUG #2119: FOREIGN KEY ON DELETE RESTRICT

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


Discuss Re: [BUGS] BUG #2119: FOREIGN KEY ON DELETE RESTRICT in the mailing.database.pgsql-bugs forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Tom Lane
 
Posts: n/a

Default Re: [BUGS] BUG #2119: FOREIGN KEY ON DELETE RESTRICT - 12-20-2005 , 09:19 AM






"Fred PerniĆ" <perniss (AT) zks-gmbh (DOT) de> writes:
Quote:
If I delete a dataset from p_kto then is also delete the referenced sets in
depot.
Normaly the RESTRICT should prevents deletion. Or?
Works for me:
regression=# delete from p_kto where kto_id = 101;
ERROR: update or delete on "p_kto" violates foreign key constraint "c_dkt_kto_id" on "depot"
DETAIL: Key (kto_id)=(101) is still referenced from table "depot".

I think you've not told us the full truth about your tables. The quoted
definitions are syntactically wrong (missing commas) and semantically
wrong (kto_id has no UNIQUE or PRIMARY KEY constraint, therefore can't
be the target of a foreign key reference). I think you stripped out
everything you thought was irrelevant, including the actual source of
the problem --- maybe there is another constraint that is ON DELETE
CASCADE, and it happens to get processed first?

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

http://archives.postgresql.org


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.