Re: Strange Behavior with Serializable Transcations

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Martijn van Oosterhout <kleptog(at)svana(dot)org>
Cc: Brad Nicholson <bnichols(at)ca(dot)afilias(dot)info>, pgsql-general(at)postgresql(dot)org
Subject: Re: Strange Behavior with Serializable Transcations
Date: 2006-06-28 20:47:49
Message-ID: 7950.1151527669@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Martijn van Oosterhout <kleptog(at)svana(dot)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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Bill Eaton 2006-06-28 21:35:37 Re: unusual "relation xxx does not exist" problem
Previous Message Tom Lane 2006-06-28 20:43:41 Re: unusual "relation xxx does not exist" problem