Re: locking of referenced table during constraint construction

Поиск
Список
Период
Сортировка
От Stephan Szabo
Тема Re: locking of referenced table during constraint construction
Дата
Msg-id 20020904144259.B60532-100000@megazone23.bigpanda.com
обсуждение исходный текст
Ответ на locking of referenced table during constraint construction  (Scott Shattuck <ss@technicalpursuit.com>)
Ответы Re: locking of referenced table during constraint  (Scott Shattuck <ss@technicalpursuit.com>)
Список pgsql-hackers
On 4 Sep 2002, Scott Shattuck wrote:

> Under what conditions would the following statement cause the USERS
> table to lock out selects?
>
>
> alter table my_coupons
>   add constraint FK_mc_user_id
>   FOREIGN KEY (mc_frn_user_id)
>   REFERENCES users(user_ID);

If I'm reading code correctly, an exclusive lock
on the pk table is grabbed which will block selects
as well. You're effectively altering both tables
(you need to add triggers to both tables) and
both get locked.




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

Предыдущее
От: Scott Shattuck
Дата:
Сообщение: locking of referenced table during constraint construction
Следующее
От: Olivier PRENANT
Дата:
Сообщение: Re: Bug in Makefile.shlib