Re: SET SESSION TRANSACTION command - Mailing list pgsql-general

From Tom Lane
Subject Re: SET SESSION TRANSACTION command
Date
Msg-id 14827.1136151841@sss.pgh.pa.us
Whole thread Raw
In response to Re: SET SESSION TRANSACTION command  (Qingqing Zhou <zhouqq@cs.toronto.edu>)
List pgsql-general
Qingqing Zhou <zhouqq@cs.toronto.edu> writes:
> 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.

This one works fine too: you misunderstand what the semantics are.
There is default_transaction_isolation which is the session-level
setting, and there is transaction_isolation which is, by definition,
reset to default_transaction_isolation at the start of every
transaction.

The only way the above command should do anything different than what
it does now is to give an error, on the grounds that it's a
contradiction in terms.  The SQL-spec spelling of what you are
interested in is
SET SESSION CHARACTERISTICS AS TRANSACTION ISOLATION LEVEL SERIALIZABLE;

            regards, tom lane

pgsql-general by date:

Previous
From: Qingqing Zhou
Date:
Subject: Re: SET SESSION TRANSACTION command
Next
From: Tony Caduto
Date:
Subject: using PG with Syslog