Re: Locking concurrency: select for update vs update
В списке pgsql-performance по дате отправления:
| От | Tom Lane |
|---|---|
| Тема | Re: Locking concurrency: select for update vs update |
| Дата | |
| Msg-id | 32195.1465305850@sss.pgh.pa.us обсуждение исходный текст |
| Ответ на | Locking concurrency: select for update vs update (Streamsoft - Mirek Szajowski <m.szajowski@streamsoft.pl>) |
| Ответы |
Re: Locking concurrency: select for update vs update
|
| Список | pgsql-performance |
Streamsoft - Mirek Szajowski <m.szajowski@streamsoft.pl> writes:
> Why I can't execute 'select for update' but I can update?
In recent PG versions, the lock held due to having inserted an FK
dependent row effectively only locks the key fields of the parent row.
UPDATE can tell whether you're trying to change the row's key fields,
and it will proceed if you aren't. SELECT FOR UPDATE has to lock the
whole row (since it must assume you might be intending to change any
fields of the row); so it blocks until the FK lock goes away.
regards, tom lane
В списке pgsql-performance по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера