From: | Dennis Gearon <gearond(at)cvc(dot)net> |
---|---|
To: | Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com> |
Cc: | gitarrerik(at)musiker(dot)nu, pgsql-general(at)postgresql(dot)org |
Subject: | Re: Server error |
Date: | 2003-05-08 22:06:21 |
Message-ID: | 3EBAD4DD.1020304@cvc.net |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | 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
>
From | Date | Subject | |
---|---|---|---|
Next Message | Stephan Szabo | 2003-05-08 22:14:53 | Re: Server error |
Previous Message | Dennis Gearon | 2003-05-08 22:04:24 | Re: Server error |