Re: A bad behavior under autocommit off mode - Mailing list pgsql-hackers

From Tom Lane
Subject Re: A bad behavior under autocommit off mode
Date
Msg-id 20193.1048134646@sss.pgh.pa.us
Whole thread Raw
In response to Re: A bad behavior under autocommit off mode  (Hiroshi Inoue <Inoue@tpf.co.jp>)
Responses Re: A bad behavior under autocommit off mode  (Bruce Momjian <pgman@candle.pha.pa.us>)
List pgsql-hackers
Hiroshi Inoue <Inoue@tpf.co.jp> writes:
> Bruce Momjian wrote:
>> This patch removes that "stuff all queries into a single transaction"
>> behavior and makes them function just like queries arriving separately.
>> This does BREAK BACKWARD COMPATIBILITY.  However, if they want the old
>> behavior, they just need to wrap BEGIN/COMMIT around the query string.

> Does the change worth the trouble ?
> Please don't break BACKWARD COMPATIBILITY easily.

I do not like this change either.  It breaks long-established behavior
simply to have an easy fix for a recently-introduced bug (and what's
more, a bug in a feature that we may end up removing completely; I like
Peter's idea that autocommit on the client side is a better approach).

It would be a serious error to imagine that psql -c strings are the only
case where this behavior applies.  PQexec and interfaces based on it
exhibit the same behavior.  The behavior is actually useful for
pipelining (send several queries in one PQsendQuery, read and process
the results one at a time with PQgetResult; then the server's processing
of the additional commands is overlapped with client-side processing of
the results).  So I believe there are applications out there depending
on it.

I think we should look for a fix that does not break compatibility.        regards, tom lane


pgsql-hackers by date:

Previous
From: "Vadim Mikheev"
Date:
Subject: Re: Nested transactions: low level stuff
Next
From: Bruce Momjian
Date:
Subject: Re: Nested transactions: low level stuff