Re: how do you get there from here?

Поиск
Список
Период
Сортировка
От Alban Hertroys
Тема Re: how do you get there from here?
Дата
Msg-id 51E9F96F-CD48-47D6-AF98-183B2E8770BF@solfertje.student.utwente.nl
обсуждение исходный текст
Ответ на Re: how do you get there from here?  ("Michael P. Soulier" <michael_soulier@mitel.com>)
Ответы Re: how do you get there from here?  ("Michael P. Soulier" <michael_soulier@mitel.com>)
Список pgsql-general
On May 13, 2009, at 8:48 PM, Michael P. Soulier wrote:

> Can someone suggest a better way that doesn't hit this "pending
> trigger"
> issue while in a transaction?


IIRC you had an initially deferred foreign key constraint? Do you
absolutely need that to be initially deferred, or deferrable even?
Because that's what's causing your problem, not the foreign key
constraint itself.

If that FK does need to be initially deferred, as a workaround you can
temporarily disable the foreign key while doing your updates. Easiest
is to drop the constraint, do your updates and recreate the
constraint, at which point the database will verify that the related
records match the constraint. Of course this opens a risk where a
record gets inserted that doesn't match your FK constraint which will
cause recreation to error out and your transaction to rollback.

Alban Hertroys

--
If you can't see the forest for the trees,
cut the trees and you'll see there is no forest.


!DSPAM:737,4a0d321a10092082955122!



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

Предыдущее
От: Raymond O'Donnell
Дата:
Сообщение: Re: Where is pg_dump?
Следующее
От: Tom Lane
Дата:
Сообщение: Re: drop table but file still exists