Re: deferrable foreign keys

Поиск
Список
Период
Сортировка
От Grzegorz Jaśkiewicz
Тема Re: deferrable foreign keys
Дата
Msg-id 2f4958ff0912020634y2ea7c238o37139b38e3ecd254@mail.gmail.com
обсуждение исходный текст
Ответ на deferrable foreign keys  (Morus Walter <morus.walter.ml@googlemail.com>)
Список pgsql-general


On Wed, Dec 2, 2009 at 2:29 PM, Morus Walter <morus.walter.ml@googlemail.com> wrote:
Hi,

are there downsides of making foreign keys deferrable (but initially
immediate) for updates, when the transaction does not set the
constraint behaviour to deferred?

I'd expect that to have the same behaviour as non deferrable foreign
keys.
What I don't understand is, why is non deferrable the default, then.

it is just sometimes desired to not check the constraints, until comit. For instance, if you run bit of code that is old, and you don't want to mess around with keys.
Or you have some strange way of putting information together.
Basically it is all about order of operation within transaction. Sometimes it cannot be guaranteed, and hence an option to defer the constraint check.



--
GJ

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

Предыдущее
От: Morus Walter
Дата:
Сообщение: deferrable foreign keys
Следующее
От: Sam Jas
Дата:
Сообщение: Re: READ ONLY & I/O ERROR