Re: Get constrrelid for fk constraints that lost it

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Get constrrelid for fk constraints that lost it
Дата
Msg-id 14377.1033679857@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Get constrrelid for fk constraints that lost it  (Stephan Szabo <sszabo@megazone23.bigpanda.com>)
Список pgsql-patches
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

В списке pgsql-patches по дате отправления:

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: AIX compilation problems (was Re: [HACKERS] Proposal ...)
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: [HACKERS] pg_dump and inherited attributes