SET TRANSACTION conformance to SQL:2003

Lists: pgsql-patches
From: Simon Riggs <simon(at)2ndquadrant(dot)com>
To: pgsql-patches(at)postgresql(dot)org
Subject: SET TRANSACTION conformance to SQL:2003
Date: 2007-09-07 13:00:32
Message-ID: 1189170032.4175.513.camel@ebony.site
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-patches

Short patch to implement SQL standard behaviour of the SET TRANSACTION
command. According to their publically accessible docs, I note that
MySQL and Ingres correctly implement this behaviour, SQLServer does this
also (and more), while Oracle and DB2 do so since they use implicit
transaction blocks.

Docs page updated.

Manual tests OK. There isn't a test suite for SET TRANSACTION, so I
haven't created one just for this. Behaviour is shown below; the SET
command sets the session characteristics of the *next* transaction, when
executed outside of a transaction block.

postgres=# show transaction_read_only;
transaction_read_only
-----------------------
off
(1 row)

postgres=# set transaction read only;
SET
postgres=# begin;
BEGIN
postgres=# show transaction_read_only;
transaction_read_only
-----------------------
on
(1 row)

postgres=# commit;
COMMIT

--
Simon Riggs
2ndQuadrant http://www.2ndQuadrant.com


From: Simon Riggs <simon(at)2ndquadrant(dot)com>
To: pgsql-patches(at)postgresql(dot)org
Subject: Re: SET TRANSACTION conformance to SQL:2003
Date: 2007-09-07 13:17:11
Message-ID: 1189171031.4175.516.camel@ebony.site
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-patches

On Fri, 2007-09-07 at 14:00 +0100, Simon Riggs wrote:
> Short patch

--
Simon Riggs
2ndQuadrant http://www.2ndQuadrant.com

Attachment Content-Type Size
set_transaction.v1.patch text/x-patch 6.4 KB

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Simon Riggs <simon(at)2ndquadrant(dot)com>
Cc: pgsql-patches(at)postgresql(dot)org
Subject: Re: SET TRANSACTION conformance to SQL:2003
Date: 2007-09-14 16:29:33
Message-ID: 200709141629.l8EGTXb28748@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-patches


This has been saved for the 8.4 release:

http://momjian.postgresql.org/cgi-bin/pgpatches_hold

---------------------------------------------------------------------------

Simon Riggs wrote:
> Short patch to implement SQL standard behaviour of the SET TRANSACTION
> command. According to their publically accessible docs, I note that
> MySQL and Ingres correctly implement this behaviour, SQLServer does this
> also (and more), while Oracle and DB2 do so since they use implicit
> transaction blocks.
>
> Docs page updated.
>
> Manual tests OK. There isn't a test suite for SET TRANSACTION, so I
> haven't created one just for this. Behaviour is shown below; the SET
> command sets the session characteristics of the *next* transaction, when
> executed outside of a transaction block.
>
> postgres=# show transaction_read_only;
> transaction_read_only
> -----------------------
> off
> (1 row)
>
> postgres=# set transaction read only;
> SET
> postgres=# begin;
> BEGIN
> postgres=# show transaction_read_only;
> transaction_read_only
> -----------------------
> on
> (1 row)
>
> postgres=# commit;
> COMMIT
>
>
> --
> Simon Riggs
> 2ndQuadrant http://www.2ndQuadrant.com
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 3: Have you checked our extensive FAQ?
>
> http://www.postgresql.org/docs/faq

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://www.enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +