Re: feature request: auto savepoint for interactive psql when in transaction.

From: Ross Reedstrom <reedstrm(at)rice(dot)edu>
To: Will Leinweber <will(at)heroku(dot)com>
Cc: David Fetter <david(at)fetter(dot)org>, Gurjeet Singh <singh(dot)gurjeet(at)gmail(dot)com>, Kevin Grittner <Kevin(dot)Grittner(at)wicourts(dot)gov>, Alvaro Herrera <alvherre(at)commandprompt(dot)com>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: feature request: auto savepoint for interactive psql when in transaction.
Date: 2011-11-14 23:05:20
Message-ID: 20111114230519.GE24723@rice.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)rice(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2011-11-14 23:28:02 Re: strict aliasing (was: const correctness)
Previous Message Bruce Momjian 2011-11-14 22:46:18 Re: Detach/attach database