Stephan Szabo <sszabo@megazone23.bigpanda.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