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

Referential integrity

From: "Mihai Gheorghiu" <tanethq(at)earthlink(dot)net>
To: <pgsql-general(at)postgresql(dot)org>
Subject: Referential integrity
Date: 2001-10-26 14:25:32
Message-ID: 013201c15e2a$134f8360$6e646464@New6.Travel (view raw, whole thread or download thread mbox)
Lists: pgsql-general
I have a table named T1 that has two signature fields, F1 and F2.
Both have referential integrity defined as references users table on update
cascade on delete set null.
When I try to change a certain username in users table, I get an error
message like Referential integrity violation key referenced from T1 not
found in users.
My guess is that this happens if a record in T1 has both F1 and F2 with the
value I'm trying to change. Probably the two referential integrity triggers
act completely separately, e.g. when trigger for F1 updates F1, the record
it is trying to save still has F2 with the old value, which violates
referential integrity.
Am I correct? How can I get out of this situation and still get the
referential integrity I need.
Thank you all.


pgsql-general by date

Next:From: Meenatchi AnbuchelvanDate: 2001-10-26 14:28:42
Subject: Blob!!!
Previous:From: Tom LaneDate: 2001-10-26 14:11:34
Subject: Re: initdb segfault - solaris 8

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