| От | Tom Lane |
|---|---|
| Тема | Re: PostgreSQL transaction locking problem |
| Дата | |
| Msg-id | 18738.1012682453@sss.pgh.pa.us обсуждение |
| Ответ на | Re: PostgreSQL transaction locking problem (Stephan Szabo <sszabo@megazone23.bigpanda.com>) |
| Ответы |
Re: PostgreSQL transaction locking problem
|
| Список | pgsql-general |
Stephan Szabo <sszabo@megazone23.bigpanda.com> writes:
> I actually thought that he's complaining about the fact that it gives him
> the same id twice if he runs it in two transactions rather than the delay
> until the first commits.
As written, he gets a delay (because of the LOCK) *and* duplicate IDs
(because with the serializable isolation level, the second xact can't
see the row inserted by the first, even after waiting for it to commit).
Worst of both worlds.
There's a reason why we provide sequences as primitive objects: you
can't build an equivalent behavior very easily under MVCC rules.
regards, tom lane
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера