Re: Changing constraints to deferrable

Поиск
Список
Период
Сортировка
От Florian G. Pflug
Тема Re: Changing constraints to deferrable
Дата
Msg-id 42417699.8030403@phlo.org
обсуждение исходный текст
Ответ на Changing constraints to deferrable  (Greg Stark <gsstark@mit.edu>)
Ответы Re: Changing constraints to deferrable  (Greg Stark <gsstark@mit.edu>)
Список pgsql-general
Greg Stark wrote:
> I want all my foreign key constraints to be deferrable. They were all created
> with the default (not deferrable).
>
> Is it enough to just do
>
>   update pg_constraint set condeferrable = 't' where contype = 'f';

No - the constraints are actually enforced by triggers - Just just
normally don't see those triggers - but if you look into pg_triggers,
you'll find them. The have "tgisconstraint" set to true, so it should
be easy to find them.

Try an additional "update pg_trigger set isdeferrable=true where
pgisconstraint = true", and it should work..

I'm not etirely sure about the fieldnames - so better check them - e.g
"\d pg_catalog.pg_trigger" could help, when typed into psql ;-)

mfg, Florian Pflug


Вложения

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

Предыдущее
От: Bruno Wolff III
Дата:
Сообщение: Re: Extracting object source code from database to store in CVS...
Следующее
От: Lonni J Friedman
Дата:
Сообщение: Re: postgres oracle emulation question