Re: Server error - Mailing list pgsql-general

From Erik Ronström
Subject Re: Server error
Date
Msg-id 20030508203549.67761.qmail@web13807.mail.yahoo.com
Whole thread Raw
In response to Re: Server error  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Server error
Re: Server error
List pgsql-general
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


pgsql-general by date:

Previous
From: Kathy Zhu
Date:
Subject: jdbc connection process size
Next
From: Diogo de Oliveira Biazus
Date:
Subject: About CLUSTER on GIST/tsearch index