Re: PostgreSQL transaction locking problem

Поиск
Список
Период
Сортировка
От 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 по дате отправления:

Предыдущее
От: Stephan Szabo
Дата:
Сообщение: Re: PostgreSQL transaction locking problem
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Preformance