| От | Alvaro Herrera |
|---|---|
| Тема | Re: Update with subselect sometimes returns wrong result |
| Дата | |
| Msg-id | 20131219005808.GI11006@eldon.alvh.no-ip.org обсуждение |
| Ответ на | Re: Update with subselect sometimes returns wrong result (Andres Freund <andres@2ndquadrant.com>) |
| Ответы |
Re: Update with subselect sometimes returns wrong result
|
| Список | pgsql-bugs |
Andres Freund escribió: > On 2013-12-18 19:13:43 -0300, Alvaro Herrera wrote: > > I'm not sure about the added assert that the tuple cannot possibly be > > locked. I fear cursors provide strange ways to access at tuples. > > I don't see how, the EPQ machinery should have ensured we're looking at > the most recent version. Also, pretty fundamentally, we have to be the > only locker, otherwise the optimization wouldn't be applicable in this > way. EPQ works funny with cursors in the WHERE CURRENT OF stuff; the fact that it behaves differently in FOR UPDATE case than when there's no locking clause makes this whole thing pretty misterious. Anyway I think this whole optimization can be formulated more clearly if we separate the case into its own block by checking XidIsCurrentTransaction instead of cramming it into the XidIsInProgress case as the original is doing; see attached. Any ideas on possible tests for this stuff? Nothing comes to mind that doesn't involve pageinspect ... -- Álvaro Herrera http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services
В списке pgsql-bugs по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера