Tom Lane wrote:
> 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).
I don't like pushing autocommit to the client.
> 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.
The fix only changes the 'make it all one transaction' behavior. It
does not effect sending multiple queries in a string --- what will
happen with the patch is that the queries will be processed using normal
transaction commit rules, rather than bunched up. Yes, I am sure this
bunching is used a lot.
Clearly we don't want to do this just to fix autocommit --- there are
other ways. But I do think the roll-queries-into-one-transaction is
strange and should be removed with the patch.
-- 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,
Pennsylvania19073