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

From: Daniel Farina <daniel(at)heroku(dot)com>
To: Ross Reedstrom <reedstrm(at)rice(dot)edu>
Cc: Will Leinweber <will(at)heroku(dot)com>, 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: 2012-08-16 07:02:07
Message-ID: CAAZKuFas67WfHse1F4JeS5_4WdEL0jXYP2hxjbWRyC4_tTF2cA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Nov 14, 2011 at 3:05 PM, Ross Reedstrom <reedstrm(at)rice(dot)edu> wrote:
> 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 :-) )

I do this and have done this all the time. Because emacs. On the
other hand, I only really do it in line-buffered modes. I also feel
there is something of a development/production parity that is broken
by this, but then again, so are backslash commands interpreted by
psql, and that has never proven to be a practical problem. That I know of.

I wouldn't let my particular use case (M-x shell) get in the way of
changing the default if that was the consensus because I think this
would help a lot more people than hurt. In the discoverability
department, one can not-hack the server error message by having psql
emit its own hint when it receives an error while in a transaction
block (vs auto-commit). This is knowable via the ReadyForQuery
message, which can tell you "idle in transaction".

--
fdr

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Marti Raudsepp 2012-08-16 09:31:06 UNION ALL with WHERE clause does not use Merge Append
Previous Message Etsuro Fujita 2012-08-16 06:11:56 Re: Don't allow relative path for copy from file