Re: Automatic transactions in psql - Mailing list pgsql-patches

From Tom Lane
Subject Re: Automatic transactions in psql
Date
Msg-id 18955.1014406651@sss.pgh.pa.us
Whole thread Raw
In response to Re: Automatic transactions in psql  ("Greg Sabino Mullane" <greg@turnstep.com>)
List pgsql-patches
"Greg Sabino Mullane" <greg@turnstep.com> writes:
> I don't think it's that unreliable myself: as long as the backend outputs
> the standard confirmation message (e.g. "BEGIN"), we should always be
> able to keep track.

But it wouldn't.  At least not in the auto-transaction-start mode.
(We couldn't send "C BEGIN" in addition to a "C" for the command that
caused the transaction start; that'd be one too many "C", and would
at least potentially confuse clients.)  Moreover, I don't think psql
can reliably know whether the backend is in auto-start mode or not;
nor should it be responsible for understanding which SQL constructs
can cause an auto transaction start.  (Not all do.)

We could define an additional message that the backend would put out at
start and end of a transaction block, but ISTM that is a protocol
change.

> <devil's advocate>
> Surely it's being done at least as reliably as the hack in large_obj.c? :)
> </da>

That crock should be eliminated, not emulated ;-)

Being able to clean up large_obj.c might actually be a sufficient reason
to change the protocol ...

            regards, tom lane

pgsql-patches by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: IPv6 Support for INET/CIDR types.
Next
From: Bruce Momjian
Date:
Subject: Re: IPv6 Support for INET/CIDR types.