| От | 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 по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера