Re: Referential integrity checking issue

From: Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com>
To: Bruno Wolff III <bruno(at)cerberus(dot)csd(dot)uwm(dot)edu>
Cc: <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: Referential integrity checking issue
Date: 2001-11-05 16:51:42
Message-ID: 20011105084607.W40711-100000@megazone23.bigpanda.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Thu, 1 Nov 2001, Bruno Wolff III wrote:

> I am having a problem where I want to delete all of the existing information
> in a database and reinitialize it in a transaction. I am reusing the
> primary key values and this results in an error with referential
> integrity checking.
>
> I think I have seen something similar to this discussed here previously, but
> I am not sure if it was exactly the same problem.

I believe so.

> Are things supposed to work like this?

Not really. What's happening I believe is that it's looking at the final
state of the database and seeing that a row in test2 matches. It then
also needs to determine if a matching row was re-inserted into test1
which it doesn't currently do. Part of the reason for this was a mistake
in reading a piece of the spec that made it appear that such constructs
were illegal, so they weren't coded for.

I have a test patch that I think fixes the base constraint and the no
action referential actions against a 7.2 but it should probably apply
okay against 7.1.x. (I think I sent it to the list a while back,
if not you can write me).

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message pgsql-bugs 2001-11-06 14:18:17 Bug #510: conditional rules sometimes work more than once
Previous Message Christof Petig 2001-11-05 15:24:54 Re: recent ECPG 7.1->7.2 incompatibility ( interval('0sec') = syntax