Re: feature request: auto savepoint for interactive psql when in transaction. - Mailing list pgsql-hackers

From Ross Reedstrom
Subject Re: feature request: auto savepoint for interactive psql when in transaction.
Date
Msg-id 20111114230519.GE24723@rice.edu
Whole thread Raw
In response to feature request: auto savepoint for interactive psql when in transaction.  (Will Leinweber <will@heroku.com>)
Responses Re: feature request: auto savepoint for interactive psql when in transaction.  (Daniel Farina <daniel@heroku.com>)
List pgsql-hackers
On Mon, Nov 14, 2011 at 02:45:04PM -0800, Will Leinweber wrote:
> My coworker Dan suggested that some people copy and paste scripts. However
> I feel that that is an orthogonal problem and if there is a very high rate
> of input psql should detect that and turn interactive off. And I
> still strongly feel that on_error_rollback=interactive should be the
> default.

Hmm, I think that falls under the "don't so that, then" usecase. I've been
known to c&p the occasional script - I guess the concern here would be not
seeing failed steps that scrolled off the terminal. (I set my scrollback to
basically infinity and actaully use it, but then I'm strange that way :-) )

Trying to autodetect 'high rate of input' seems ... problematic. The code as is
does handle detecting interactivity at startup, and for the current command
- switching mid-stream ... catching repeated auto-rollbacks might be a possibility, then switching the transaction into
'failed'state. That should
 
catch most of the possible cases where an early set of steps failed, but
scrolled off, so there's no visible error at the end of paste.
> Until then, I've included this as a PSA at the start of any postgres talks
> I've given, because it's simply not widely known.

Good man. (That's a Postgres Service Announcement, then?)

Ross
-- 
Ross Reedstrom, Ph.D.                                 reedstrm@rice.edu
Systems Engineer & Admin, Research Scientist        phone: 713-348-6166
Connexions                  http://cnx.org            fax: 713-348-3665
Rice University MS-375, Houston, TX 77005
GPG Key fingerprint = F023 82C8 9B0E 2CC6 0D8E  F888 D3AE 810E 88F0 BEDE


pgsql-hackers by date:

Previous
From: Martijn van Oosterhout
Date:
Subject: Re: strict aliasing (was: const correctness)
Next
From: Andres Freund
Date:
Subject: Re: strict aliasing (was: const correctness)