Re: BUG #13523: Unexplained deadlocks (possible race condition)
В списке pgsql-bugs по дате отправления:
| От | Jack Douglas |
|---|---|
| Тема | Re: BUG #13523: Unexplained deadlocks (possible race condition) |
| Дата | |
| Msg-id | 01b001d0c960$894af9e0$9be0eda0$@douglastechnology.co.uk обсуждение исходный текст |
| Ответ на | Re: BUG #13523: Unexplained deadlocks (possible race condition) (Tom Lane <tgl@sss.pgh.pa.us>) |
| Список | pgsql-bugs |
> I believe the issue with this is that a SQL function will do parsing (and maybe planning too; don't feel like checking the code right now) for the entire function body at once. This means that due to the INSERT command you acquire RowExclusiveLock on the "test" table during function body parsing, before the LOCK command actually executes. So the LOCK represents a lock escalation attempt, and deadlocks are to be expected. That makes perfect sense, many thanks for the explanation. > This coding technique would be safe in plpgsql, but not in a SQL-language function. That's useful to know - I already worked around the issue with a retry-loop (as I'm basically doing an upsert the 'bad' way with `lock table` - roll on 9.5!) Kind regards Jack
В списке pgsql-bugs по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера