Re: A bad behavior under autocommit off mode

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Hiroshi Inoue <Inoue(at)tpf(dot)co(dot)jp>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: A bad behavior under autocommit off mode
Date: 2003-03-24 18:29:43
Message-ID: 200303241829.h2OITh522132@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


OK, I have applied the following patch to fix the original bug report:

psql -c "SET autocommit TO off;SELECT 1;COMMIT;" template1

It turns off grouping of queries into a single transaction when
autocommit is off, and documents that grouping behavior when autocommit
is on. (It also removes a mention of porting from 6.4.)

This may get removed if we move autocommit to the client, but at least
it is done, and documented.

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

Bruce Momjian wrote:
> Tom Lane wrote:
> > Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
> > > The fix only changes the 'make it all one transaction' behavior. It
> > > does not effect sending multiple queries in a string ---
> >
> > Yes it does! The results may change. Also the behavior if later
> > commands in the string fail will be different (roll back earlier
> > commands vs not).
>
> Right, people are using it, but do they even know that those are all one
> transaction? I bet most don't.
>
> > > But I do think the roll-queries-into-one-transaction is
> > > strange and should be removed with the patch.
> >
> > I disagree. This is long-established behavior and no one has complained
> > about it. We have gone out of our way to preserve it in past changes;
> > I don't like suddenly deciding that backwards compatibility is
> > unimportant. Especially not if only one person is in favor of the change.
>
> I asked for some votes.
>
> --
> Bruce Momjian | http://candle.pha.pa.us
> pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
> + If your life is a hard drive, | 13 Roberts Road
> + Christ can be your backup. | Newtown Square, Pennsylvania 19073
>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: Have you searched our list archives?
>
> http://archives.postgresql.org
>

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

Attachment Content-Type Size
unknown_filename text/plain 3.4 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Treat 2003-03-24 18:38:29 Re: Regular expressions in PostgreSQL
Previous Message Dave Cramer 2003-03-24 18:21:48 Re: Please clarify with regard to Renaming a Sequence