Re: Incorrect START TRANSACTION implementation

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Incorrect START TRANSACTION implementation
Date: 2004-01-27 18:21:18
Message-ID: 25187.1075227678@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Peter Eisentraut <peter_e(at)gmx(dot)net> writes:
> SQL99 part 2 clause 16.1 contains this note:
> NOTE 327 - The characteristics of a transaction begun by a
> <start transaction statement> are as specified in these General
> Rules regardless of the characteristics specified by any
> preceding <set transaction statement>. That is, even if one
> or more characteristics are omitted by the <start transaction
> statement>, the defaults specified in the Syntax Rules of this
> Subclause are effective and are not affected by any (preceding)
> <set transaction statement>.

> In other words, this should work:

> peter=# set session characteristics as transaction read only;
> SET
> peter=# start transaction;
> START TRANSACTION
> peter=# create table test (a int);
> ERROR: transaction is read-only

Are you sure you're reading that correctly? It says <set transaction
statement> not <set session characteristics statement>. What use would
SET SESSION CHARACTERISTICS have at all, if it's ignored by START
TRANSACTION?

It appears to me that the spec is saying that *this* should work:

regression=# set transaction read only;
SET
regression=# start transaction;
START TRANSACTION
regression=# create table test (a int);
CREATE TABLE

... which it does.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2004-01-27 18:28:05 Re: index scan with functional indexes
Previous Message Tom Lane 2004-01-27 18:13:45 Re: Function call