"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!