Re: PSQL undesired transaction behavior when connection is lost. - Mailing list pgsql-general

From Tom Lane
Subject Re: PSQL undesired transaction behavior when connection is lost.
Date
Msg-id 23483.1097181206@sss.pgh.pa.us
Whole thread Raw
In response to Re: PSQL undesired transaction behavior when connection is lost.  (Steven Klassen <sklassen@commandprompt.com>)
Responses Re: PSQL undesired transaction behavior when connection is lost.  (Steven Klassen <sklassen@commandprompt.com>)
List pgsql-general
Steven Klassen <sklassen@commandprompt.com> writes:
> * Mike Benoit <ipso@snappymail.ca> [2004-10-07 11:47:50 -0700]:
>> I assume I'm not the first person to run in to this, however
>> searching google didn't seem to come up with anything useful.

> AFAICT, the first query is just constructed poorly, while the second
> seems to recurse on itself. The order in the sub-selects doesn't seen
> necessary either.

Agreed, but I think that's irrelevant to his point: psql probably
should abandon whatever is left in its input buffer after getting an
error from the backend, and almost certainly should do so after loss
of connection.  In the noninteractive case I believe it will quit
executing the script file, which is good, but in the interactive case
it seems like a mistake not to flush the query buffer.

Peter, do you know if this behavior was intentional, or just an
implementation artifact?

            regards, tom lane

pgsql-general by date:

Previous
From: Martijn van Oosterhout
Date:
Subject: Question about timezones
Next
From: Steven Klassen
Date:
Subject: Re: PSQL undesired transaction behavior when connection is lost.