Skip site navigation (1) Skip section navigation (2)

Re: Strange Behavior with Serializable Transcations

From: "Qingqing Zhou" <zhouqq(at)cs(dot)toronto(dot)edu>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Strange Behavior with Serializable Transcations
Date: 2006-06-30 02:11:31
Message-ID: e82190$1jpk$1@news.hub.org (view raw or flat)
Thread:
Lists: pgsql-general
"Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)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



In response to

Responses

pgsql-general by date

Next:From: Tom LaneDate: 2006-06-30 02:27:02
Subject: Re: Strange Behavior with Serializable Transcations
Previous:From: Tim HartDate: 2006-06-29 21:58:23
Subject: Re: User privileges in web database applications

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group