Re: Lock table, Select for update and Serialization error
В списке pgsql-general по дате отправления:
| От | sudhir |
|---|---|
| Тема | Re: Lock table, Select for update and Serialization error |
| Дата | |
| Msg-id | 4653281F.7030908@cse.iitb.ac.in обсуждение исходный текст |
| Ответ на | Re: Lock table, Select for update and Serialization error (Tom Lane <tgl@sss.pgh.pa.us>) |
| Список | pgsql-general |
It is not necessary that LOCK TABLE will be the first statement. (assuming serializable isolation level is snapshot isolation in postgres) For serializable transaction, snapshot should be taken when the 'BEGIN' statement is executed, and not when LOCK TABLE succeeds. Hence, uncommitted changes should be invisible to serializable transaction. > The critical point here is that LOCK TABLE commands at the start of a > serializable transaction are performed *before* taking the transaction's > snapshot (the snap happens at the first regular DML command). They not > only protect against post-snap changes as shown by Albe's example, but > against uncommitted changes that were made before transaction start > (by making the serializable xact wait until those changes are committed > or aborted before it takes its snap). > >
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера