
It seems to me that new 'begin isolation level ...' syntax does not work
with current cvs head:

#
# old syntax:
#
psql> SELECT VERSION();
                          version
---------------------------------------------------------------------------
 PostgreSQL 7.5devel on i686-pc-linux-gnu, compiled by GCC gcc (GCC) 3.3.3
(Debian 20040401)

psql> BEGIN;
BEGIN
psql> SET TRANSACTION ISOLATION LEVEL SERIALIZABLE;
SET
psql> SHOW TRANSACTION ISOLATION LEVEL;
 transaction_isolation
-----------------------
 serializable


#
# new syntax?
#

psql> BEGIN TRANSACTION ISOLATION LEVEL SERIALIZABLE;
BEGIN
psql> SHOW TRANSACTION ISOLATION LEVEL;
 transaction_isolation
-----------------------
 read committed


I would have expected 'serializable' ?

"If the isolation level or read/write mode is specified, the new
transaction has those characteristics, as if SET TRANSACTION was
executed."

-- 
Fabien Coelho - coelho@cri.ensmp.fr

Mon, 19 Apr 2004 18:54:05 +0200 (CEST)
Fabien COELHO <coelho@cri.ensmp.fr>
'begin transaction' new syntax bug?
Fabien COELHO wrote:
> #
> # new syntax?
> #
> 
> psql> BEGIN TRANSACTION ISOLATION LEVEL SERIALIZABLE;
> BEGIN
> psql> SHOW TRANSACTION ISOLATION LEVEL;
>  transaction_isolation
> -----------------------
>  read committed

OK, fixed:

	test=> BEGIN TRANSACTION ISOLATION LEVEL SERIALIZABLE;
	BEGIN
	test=> SHOW TRANSACTION ISOLATION LEVEL;
	 transaction_isolation
	-----------------------
	 serializable
	(1 row)

I added the ability to use such clauses to BEGIN in January for 7.5, but
I never tested it using SHOW.  I thought the START TRANSACTION and BEGIN
code would handle the clause code the same, but BEGIN was ignoring it.

Patch attached and applied.

Thanks for the report.

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

Index: src/backend/tcop/utility.c
===================================================================
RCS file: /cvsroot/pgsql-server/src/backend/tcop/utility.c,v
retrieving revision 1.211
diff -c -c -r1.211 utility.c
*** src/backend/tcop/utility.c	23 Mar 2004 19:35:17 -0000	1.211
--- src/backend/tcop/utility.c	19 Apr 2004 21:16:57 -0000
***************
*** 302,316 ****
  
  				switch (stmt->kind)
  				{
  					case TRANS_STMT_BEGIN:
- 						BeginTransactionBlock();
- 						break;
- 
- 						/*
- 						 * START TRANSACTION, as defined by SQL99:
- 						 * Identical to BEGIN, except that it takes a few
- 						 * additional options.
- 						 */
  					case TRANS_STMT_START:
  						{
  							BeginTransactionBlock();
--- 302,313 ----
  
  				switch (stmt->kind)
  				{
+ 					/*
+ 					 * START TRANSACTION, as defined by SQL99:
+ 					 * Identical to BEGIN, except that it takes a few
+ 					 * additional options.  Same code for both.
+ 					 */
  					case TRANS_STMT_BEGIN:
  					case TRANS_STMT_START:
  						{
  							BeginTransactionBlock();
Index: src/backend/utils/misc/guc.c
===================================================================
RCS file: /cvsroot/pgsql-server/src/backend/utils/misc/guc.c,v
retrieving revision 1.199
diff -c -c -r1.199 guc.c
*** src/backend/utils/misc/guc.c	7 Apr 2004 18:52:26 -0000	1.199
--- src/backend/utils/misc/guc.c	19 Apr 2004 21:17:01 -0000
***************
*** 3394,3399 ****
--- 3394,3401 ----
  SetPGVariable(const char *name, List *args, bool is_local)
  {
  	char	   *argstring = flatten_set_variable_args(name, args);
+ printf("bjm:  %s %s\n", name, argstring);
+ fflush(stdout);
  
  	/* Note SET DEFAULT (argstring == NULL) is equivalent to RESET */
  	set_config_option(name,
Mon, 19 Apr 2004 17:20:33 -0400 (EDT)
Bruce Momjian <pgman@candle.pha.pa.us>
Re: 'begin transaction' new syntax bug?
Please ignore the 'bjm' debug code that was part of the patch.  It has
been removed from CVS.

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

Mon, 19 Apr 2004 17:22:59 -0400 (EDT)
Bruce Momjian <pgman@candle.pha.pa.us>
Re: 'begin transaction' new syntax bug?
Christopher Kings-Lynne wrote:
> >   	char	   *argstring = flatten_set_variable_args(name, args);
> > + printf("bjm:  %s %s\n", name, argstring);
> > + fflush(stdout);
> >   
> 
> Did you really mean to include that? :)

Nope, posted a followup that it was removed in a later commit.

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

Mon, 19 Apr 2004 21:19:20 -0400 (EDT)
Bruce Momjian <pgman@candle.pha.pa.us>
Re: 'begin transaction' new syntax bug?
>   	char	   *argstring = flatten_set_variable_args(name, args);
> + printf("bjm:  %s %s\n", name, argstring);
> + fflush(stdout);
>   

Did you really mean to include that? :)

Chris


Tue, 20 Apr 2004 09:22:28 +0800
Christopher Kings-Lynne <chriskl@familyhealth.com.au>
Re: 'begin transaction' new syntax bug?