Re: Server error - Mailing list pgsql-general

From Dennis Gearon
Subject Re: Server error
Date
Msg-id 3EBAD4DD.1020304@cvc.net
Whole thread Raw
In response to Re: Server error  (Stephan Szabo <sszabo@megazone23.bigpanda.com>)
Responses Re: Server error
List pgsql-general
it does a full scan of the table's child and parent columns upon creation of a foreign key?

Stephan Szabo wrote:
> On Thu, 8 May 2003, [iso-8859-1] Erik Ronstr?m wrote:
>
>
>>Still stuck with the same error. Finally managed to upgrade from 7.2.1
>>to 7.2.4, and realized that the problem is still there. Shit! I've not
>>yet been able to reproduce the problem on another location, but at
>>least I've isolated it a bit:
>>
>>I have a function which creates a "cache" table with a subset of rows
>>from another table (CREATE TABLE new AS SELECT ... FROM old WHERE ...).
>>Then it adds a foreign key (ALTER TABLE new ADD CONSTRAINT ref FOREIGN
>>KEY ... REFERENCES old). Everything is fine so far. Now, if I drop the
>>new table and run the function again, postgres crashes.
>
>
> I can reproduce on 7.2 but not 7.3 or 7.4.  It looks like something is
> getting clobbered.  When I recompiled with debug and asserting, I get a
> crash the first time the function is called.  You may need to go through
> with a debugger.
>
>
>>One question is: is it always safe to create a foreign key constraint,
>>even when the table contains data?
>
>
> It'll error if the constraint is violated or invalid, but otherwise it
> should be.
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 5: Have you checked our extensive FAQ?
>
> http://www.postgresql.org/docs/faqs/FAQ.html
>


pgsql-general by date:

Previous
From: Dennis Gearon
Date:
Subject: Re: Server error
Next
From: Stephan Szabo
Date:
Subject: Re: Server error