Re: Server error

From: Erik Ronström <kvarken(at)yahoo(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Server error
Date: 2003-05-08 20:35:49
Message-ID: 20030508203549.67761.qmail@web13807.mail.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Diogo de Oliveira Biazus 2003-05-08 20:49:19 About CLUSTER on GIST/tsearch index
Previous Message Kathy Zhu 2003-05-08 20:28:32 jdbc connection process size