Skip site navigation (1) Skip section navigation (2)

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: (view raw, whole thread or download thread mbox)
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

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

pgsql-patches by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group