Re: SET SESSION TRANSACTION command

Поиск
Список
Период
Сортировка
От Qingqing Zhou
Тема Re: SET SESSION TRANSACTION command
Дата
Msg-id Pine.LNX.4.58.0601011539370.14920@eon.cs
обсуждение исходный текст
Ответ на Re: SET SESSION TRANSACTION command  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: SET SESSION TRANSACTION command  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general

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

В списке pgsql-general по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: SET SESSION TRANSACTION command
Следующее
От: Tom Lane
Дата:
Сообщение: Re: SET SESSION TRANSACTION command