Re: using deferred initially deferred to solve foreign key checking issues
В списке pgsql-general по дате отправления:
| От | Tom Lane |
|---|---|
| Тема | Re: using deferred initially deferred to solve foreign key checking issues |
| Дата | |
| Msg-id | 11844.1156281672@sss.pgh.pa.us обсуждение исходный текст |
| Ответ на | using deferred initially deferred to solve foreign key checking issues (Philip de Nier <philip.denier@rd.bbc.co.uk>) |
| Список | pgsql-general |
Philip de Nier <philip.denier@rd.bbc.co.uk> writes:
> The solutions I could find in the mailing lists were either to upgrade to
> version 8.1 which uses "SELECT ... FOR SHARE" (I'm currently using 8.0),
> stop using foreign keys or add "DEFERRABLE INITIALLY DEFERRED" to the
> constraints. For now I'd prefer to use the last option.
> Does using "DEFERRABLE INITIALLY DEFERRED" completely solve the problem of
> transactions waiting for each other to release locks resulting from "SELECT
> ... FOR UPDATE"?
It doesn't eliminate the problem, but it does narrow the window in which
the lock is held by quite a bit, by postponing the FK checks until just
before transaction commit.
> How are the deferred foreign key constraints checked - are they checked one
> at a time?
Yeah.
regards, tom lane
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера