From: | Dennis Gearon <gearond(at)cvc(dot)net> |
---|---|
To: | gitarrerik(at)musiker(dot)nu |
Cc: | pgsql-general(at)postgresql(dot)org |
Subject: | Re: Server error |
Date: | 2003-05-08 22:04:24 |
Message-ID: | 3EBAD468.9050500@cvc.net |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
name your tables with some sort of sequence and a concatenation like:
create table 'temp' || next_val(blah blah) AS blah blah, making sure to delete of course :-)
It will avoid any race conditions on cleanup. Do this for awhile, and check the catalogs and make sure that everything DOES get cleaned up.
Erik Ronström wrote:
> Hello,
>
> 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.
>
> Things to note:
> 1) If the old table doesn't contain any rows *when running the query
> the first time*, there is no crash the second time.
> 2) If I execute the queries from the function "manually", typing them
> into psql, everything works fine.
>
> Looks to me like there is some sort of cleanup problem, since it is
> almost always the second run (in each session) that crashes.
>
> One question is: is it always safe to create a foreign key constraint,
> even when the table contains data?
>
> Erik
>
> __________________________________________________
> Yahoo! Plus
> For a better Internet experience
> http://www.yahoo.co.uk/btoffer
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: Have you searched our list archives?
>
> http://archives.postgresql.org
>
>
From | Date | Subject | |
---|---|---|---|
Next Message | Dennis Gearon | 2003-05-08 22:06:21 | Re: Server error |
Previous Message | Stephan Szabo | 2003-05-08 21:53:57 | Re: Server error |