Did anything come of this discussion on whether SET initiates a 
transaction or not?

In summary what is the right way to deal with setting autocommit in clients?

thanks,
--Barry


-------- Original Message --------
Subject: Re: [JDBC] Patch for handling "autocommit=false" in postgresql.conf
Date: Tue, 17 Sep 2002 10:26:14 -0400
From: Tom Lane <tgl@sss.pgh.pa.us>
To: snpe <snpe@snpe.co.yu>
CC: pgsql-jdbc <pgsql-jdbc@postgresql.org>
References: <200209171425.50940.snpe@snpe.co.yu>

snpe <snpe@snpe.co.yu> writes:
 > +               // handle autocommit=false in postgresql.conf
 > +                if (haveMinimumServerVersion("7.3")) {
 > +                               ExecSQL("set autocommit to on; commit;");
 > +               }

The above will fill people's logs with
	WARNING:  COMMIT: no transaction in progress
if they don't have autocommit off.

Use
	begin; set autocommit to on; commit;
instead.

I would recommend holding off on this patch altogether, actually,
until we decide whether SET will be a transaction-initiating
command or not.  I would still like to persuade the hackers community
that it should not be.

			regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org





Thu, 10 Oct 2002 17:57:55 -0700
Barry Lind <barry@xythos.com>
[Fwd: Re: [JDBC] Patch for handling "autocommit=false" in
	postgresql.conf]
Barry Lind wrote:
> Did anything come of this discussion on whether SET initiates a 
> transaction or not?

SET does not start a multi-statement transaction when autocommit is off.

> In summary what is the right way to deal with setting autocommit in clients?

I guess just 'set autocommit to on' will do it.


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

Fri, 11 Oct 2002 01:17:02 -0400 (EDT)
Bruce Momjian <pgman@candle.pha.pa.us>
Re: [Fwd: Re: [JDBC] Patch for handling "autocommit=false"
Barry,
Never mind.
Patch with 'begin;set autocommit to on;commit' work fine for JDBC spec.

regards,
Haris Peco 
On Friday 11 October 2002 02:57 am, Barry Lind wrote:
> Did anything come of this discussion on whether SET initiates a
> transaction or not?
>
> In summary what is the right way to deal with setting autocommit in
> clients?
>
> thanks,
> --Barry
>
>
> -------- Original Message --------
> Subject: Re: [JDBC] Patch for handling "autocommit=false" in
> postgresql.conf Date: Tue, 17 Sep 2002 10:26:14 -0400
> From: Tom Lane <tgl@sss.pgh.pa.us>
> To: snpe <snpe@snpe.co.yu>
> CC: pgsql-jdbc <pgsql-jdbc@postgresql.org>
> References: <200209171425.50940.snpe@snpe.co.yu>
>
> snpe <snpe@snpe.co.yu> writes:
>  > +               // handle autocommit=false in postgresql.conf
>  > +                if (haveMinimumServerVersion("7.3")) {
>  > +                               ExecSQL("set autocommit to on;
>  > commit;"); +               }
>
> The above will fill people's logs with
> 	WARNING:  COMMIT: no transaction in progress
> if they don't have autocommit off.
>
> Use
> 	begin; set autocommit to on; commit;
> instead.
>
> I would recommend holding off on this patch altogether, actually,
> until we decide whether SET will be a transaction-initiating
> command or not.  I would still like to persuade the hackers community
> that it should not be.
>
> 			regards, tom lane
>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: Have you searched our list archives?
>
> http://archives.postgresql.org
>
>
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 5: Have you checked our extensive FAQ?
>
> http://www.postgresql.org/users-lounge/docs/faq.html


Fri, 11 Oct 2002 14:37:31 +0200
snpe <snpe@snpe.co.yu>
Re: [Fwd: Re: [JDBC] Patch for handling "autocommit=false" in
	postgresql.conf]