On Sun, 1 Jan 2006, Tom Lane wrote:
> "Qingqing Zhou" <zhouqq@cs.toronto.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