Re: SET SESSION TRANSACTION command

From: Qingqing Zhou <zhouqq(at)cs(dot)toronto(dot)edu>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: SET SESSION TRANSACTION command
Date: 2006-01-01 21:02:23
Message-ID: Pine.LNX.4.58.0601011539370.14920@eon.cs
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Sun, 1 Jan 2006, Tom Lane wrote:

> "Qingqing Zhou" <zhouqq(at)cs(dot)toronto(dot)edu> writes:
> > test=# SET SESSION TRANSACTION ISOLATION LEVEL SERIALIZABLE;
>
> SESSION is taken as a noise word here. Possibly we should disallow this
> syntax altogether, since it isn't SQL-spec ... but I'm not sure it's
> worth contorting the grammar enough to do that.
>

Other GUC variables work well of the SET SESSION after a few tests. How
about we try to support it? There are 3 levels (not including LOCAL
SESSION which I don't understand) of setting isoLevel and list them by
their priority:

isoLevel[0]: Transaction level : BEGIN TRANSACTION ISOLATION
isoLevel[1]: Session level: SET SESSION TRANSACTION
isoLevel[2]: global level: default_transaction_isolation in postgres.conf
or by SET;

So the algorithm of setting XactIsoLevel at beginning of transaction will
be:

/* StartTransaction() */
for (i=3; i>0; i--)
if (isoLevel[i] has a value)
XactIsoLevel = isoLevel[i];

Or is there a consideration that we can't do this (means which will cause
broken transaction semantics something)?

Regards,
Qingqing

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2006-01-01 21:44:01 Re: SET SESSION TRANSACTION command
Previous Message Tom Lane 2006-01-01 20:22:28 Re: SET SESSION TRANSACTION command