Re: Strange Behavior with Serializable Transcations

Поиск
Список
Период
Сортировка
От Qingqing Zhou
Тема Re: Strange Behavior with Serializable Transcations
Дата
Msg-id e82190$1jpk$1@news.hub.org
обсуждение исходный текст
Ответ на Strange Behavior with Serializable Transcations  (Brad Nicholson <bnichols@ca.afilias.info>)
Ответы Re: Strange Behavior with Serializable Transcations
Список pgsql-general
"Tom Lane" <tgl@sss.pgh.pa.us> wrote
>
> 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.
>

Hm, mostly I understand it as an optimization. What do you mean by "it lets
the transaction take table locks before its snapshot becomes set"?  If we
take a snapshot at BEGIN, then the transaction can't take table locks?

test=# begin;select count(*) from k;
BEGIN
 count
-------
  9999
(1 row)

test=# lock table k;
LOCK TABLE

Regards,
Qingqing



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

Предыдущее
От: Tim Hart
Дата:
Сообщение: Re: User privileges in web database applications
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Strange Behavior with Serializable Transcations