Re: Get constrrelid for fk constraints that lost it

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com>
Cc: pgsql-patches(at)postgresql(dot)org
Subject: Re: Get constrrelid for fk constraints that lost it
Date: 2002-10-03 21:17:37
Message-ID: 14377.1033679857@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com> writes:
>> I was inclined to think it should take the constraint and let the
>> failure occur at runtime. A NOTICE would be okay but not an ERROR.

> That's easy enough to do (changing a a false to true and an ERROR
> to NOTICE I believe)

OK, applied this second version of the patch (with some minor cleanups).

If CREATE TRIGGER is unable to resolve the missing FROM clause, you get
something like

psql:r72.dump:81: NOTICE: Unable to find table for constraint "<unnamed>"

while loading the dump, and then

z=# insert into zot values(22);
ERROR: No target table given for trigger "RI_ConstraintTrigger_149654" on "zot"
Remove these RI triggers and do ALTER TABLE ADD CONSTRAINT
z=#

when the trigger is fired (instead of "Relation 0 unknown").

If anyone's got an idea for a better one-liner hint for that error message,
I'm open to suggestions.

regards, tom lane

In response to

Browse pgsql-patches by date

  From Date Subject
Next Message Alvaro Herrera 2002-10-03 21:29:47 Re: DROP COLUMN misbehaviour with multiple inheritance
Previous Message Tino Wildenhain 2002-10-03 20:35:08 Re: [HACKERS] Anyone want to assist with the