Re: 9.1/9.2 SERIALIZABLE: expected serialization failure between INSERT and SELECT not encountered

Поиск
Список
Период
Сортировка
От Chris Angelico
Тема Re: 9.1/9.2 SERIALIZABLE: expected serialization failure between INSERT and SELECT not encountered
Дата
Msg-id CAPTjJmorByK-vGVaL7YmcFm=gpMtqKGO5BeTQ2bzCqJyiaVfow@mail.gmail.com
обсуждение исходный текст
Ответ на Re: 9.1/9.2 SERIALIZABLE: expected serialization failure between INSERT and SELECT not encountered  ("Kevin Grittner" <kgrittn@mail.com>)
Список pgsql-general
On Thu, Oct 18, 2012 at 11:26 PM, Kevin Grittner <kgrittn@mail.com> wrote:
> updating a "last_used" number in a table and
> using the result (if it is *is* critical that there are no gaps in
> the numbers).

Correct me if I'm wrong, but wouldn't:

update some_table set last_used=last_used+1 returning last_used

simply block until the other transaction is committed/rolled back?
That avoids all the issues of serialization AND retrying transactions.
Or is the delay itself a problem?

ChrisA


В списке pgsql-general по дате отправления:

Предыдущее
От: "Kevin Grittner"
Дата:
Сообщение: Re: 9.1/9.2 SERIALIZABLE: expected serialization failure between INSERT and SELECT not encountered
Следующее
От: "Kevin Grittner"
Дата:
Сообщение: Re: 9.1/9.2 SERIALIZABLE: expected serialization failure between INSERT and SELECT not encountered