Re: SET TRANSACTION not compliant with SQL:2003 - Mailing list pgsql-hackers

From Gregory Stark
Subject Re: SET TRANSACTION not compliant with SQL:2003
Date
Msg-id 87y77nibo4.fsf@oxford.xeocode.com
Whole thread Raw
In response to Re: SET TRANSACTION not compliant with SQL:2003  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
"Tom Lane" <tgl@sss.pgh.pa.us> writes:

> I believe the reason the spec is written in the particular way that
> it is is that they wanted to allow, e.g.,
>
>     set transaction isolation level serializable;
>     set transaction read only;
>     sql-command;
>     sql-command;
>     ...
>     commit;

So that works currently. I think you're right that the spec has to be read
assuming autocommit off.

postgres=# \set AUTOCOMMIT off
postgres=# set transaction isolation level serializable;
SET
postgres=# set transaction read only;
SET
postgres=# create table foo (i integer);
ERROR:  transaction is read-only
postgres=# rollback;
ROLLBACK
postgres=# set transaction read only;
SET
postgres=# set transaction isolation level serializable;
SET
postgres=# create table i (integer i);
ERROR:  transaction is read-only


--  Gregory Stark EnterpriseDB          http://www.enterprisedb.com Ask me about EnterpriseDB's 24x7 Postgres support!


pgsql-hackers by date:

Previous
From: Heikki Linnakangas
Date:
Subject: Re: Commit fest queue
Next
From: Gregory Stark
Date:
Subject: Re: [PATCHES] libpq type system 0.9a