In tcop/utility.c, the isolation level is set with a call like:

SetPGVariable("transaction_isolation", makeList(item->arg), false)

when a BEGIN SERIALIZABLE etc. call is made.

Why is the isLocal-parameter false? Couldn't it be true as well? It works
as it is, since the XactIsoLevel variable is reset to default value in
StartTransaction anyway, but it looks silly to me to define the variable
as a session variable when in fact it acts like a local one.

I bumped into this because my current 2PC doesn't allow you to set session
variables. I modified the above line, and BEGIN SERIALIZABLE seems to
work fine now with 2PC.

- Heikki


Tue, 18 May 2004 16:43:01 +0300
Heikki Linnakangas <hlinnaka@iki.fi>
XactIsoLevel handling
Heikki Linnakangas <hlinnaka@iki.fi> writes:
> Why is the isLocal-parameter false? Couldn't it be true as well? It works
> as it is, since the XactIsoLevel variable is reset to default value in
> StartTransaction anyway, but it looks silly to me to define the variable
> as a session variable when in fact it acts like a local one.

Perhaps it could be true instead, but I see no point in invoking the
extra overhead of the local-variable mechanism given that this variable
is special-cased anyway.

> I bumped into this because my current 2PC doesn't allow you to set session
> variables.

Seems like the problem is right there, not with XactIsoLevel ... you
cannot seriously claim that that is an acceptable restriction.

			regards, tom lane

Tue, 18 May 2004 20:24:31 -0400
Tom Lane <tgl@sss.pgh.pa.us>
Re: XactIsoLevel handling 