Re: Strange Behavior with Serializable Transcations

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Strange Behavior with Serializable Transcations
Дата
Msg-id 7950.1151527669@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Strange Behavior with Serializable Transcations  (Martijn van Oosterhout <kleptog@svana.org>)
Список pgsql-general
Martijn van Oosterhout <kleptog@svana.org> writes:
> I think the issue here is that transaction begin is not when you type
> "begin" but at your first actual query. You can obviously only start a
> transaction once you know what serialisation level you want, and you
> don't see that till after the begin.

Right, the snapshot does not become set until you do a non-utility
command (normally, SELECT/INSERT/UPDATE/DELETE).  This is a feature, not
a bug, because it lets the transaction take table locks before its
snapshot becomes set.  I believe the Fine Manual's discussion of
concurrency includes some examples where such locks are needed ...

            regards, tom lane

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: unusual "relation xxx does not exist" problem
Следующее
От: "Bill Eaton"
Дата:
Сообщение: Re: unusual "relation xxx does not exist" problem