Re: pg_restore --disable-triggers does not stop triggers

Поиск
Список
Период
Сортировка
От CN
Тема Re: pg_restore --disable-triggers does not stop triggers
Дата
Msg-id 1128684567.28473.244633640@webmail.messagingengine.com
обсуждение исходный текст
Ответ на Re: pg_restore --disable-triggers does not stop triggers  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
Tom,

Thank you very much for the enlightenment again!

> > I notice that PostgreSQL does disable triggers but it seems to not
> > disable CHECK constraint:
>
> Why should it?
>
> (Hint: a check constraint that looks at anything but the row being
> checked is broken by definition.)

Maybe my case is rare in the real world, but this is my problem:

I use CHECK(MyFunc(column_1,column_2)) because foreign key constraint is
insufficient to do the complicate check for that table. Such design
works well for production run but problem happens during database
restore. It happens because MyFunc() raises exception as the data of
this table with CHECK constraint is being restored before the data of
the table(s) referenced by MyFunc().

Is it a wise request for one more option to be added to pg_restore to
disable CHECK constraint?

Best Regards,

CN

--
http://www.fastmail.fm - Accessible with your email software
                          or over the web


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

Предыдущее
От: Martijn van Oosterhout
Дата:
Сообщение: Re: Shell script to extract a table from a plain text dump
Следующее
От: Moises Alberto Lindo Gutarra
Дата:
Сообщение: Re: How to delete Large Object from Database?