Re: constraint modification on todo list

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: constraint modification on todo list
Дата
Msg-id 3128.1063056162@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: constraint modification on todo list  (Jeroen Ruigrok/asmodai <asmodai@wxs.nl>)
Список pgsql-hackers
Jeroen Ruigrok/asmodai <asmodai@wxs.nl> writes:
> Because what I can imagine, and please correct me if I miss something in
> my thought pattern, you have a small gap between dropping a constraint
> and adding the new one allowing the possibility of missing checks.

If you're concerned about concurrent transactions, you should do the
change like this:
begin;alter table drop constraint ...;alter table add constraint ...;commit;

which leaves no window for missed checks.  (The first ALTER will take
out an exclusive lock on the table, which will be held till end of
transaction.)
        regards, tom lane


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: constraint modification on todo list
Следующее
От: Tom Lane
Дата:
Сообщение: Re: pgsql in shared lib