Re: Defaulting psql to ON_ERROR_ROLLBACK=interactive

From: Andreas 'ads' Scherbaum <adsmail(at)wars-nicht(dot)de>
To: Robert Haas <robertmhaas(at)gmail(dot)com>, Peter van Hardenberg <pvh(at)pvh(dot)ca>
Cc: "pgsql-hackers(at)postgresql(dot)org Hackers" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Defaulting psql to ON_ERROR_ROLLBACK=interactive
Date: 2017-03-16 11:33:41
Message-ID: 3a1edb1d-cf91-d9c3-d8da-e1cfe10bcfb8@wars-nicht.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 15.03.2017 16:38, Robert Haas wrote:
> On Wed, Mar 15, 2017 at 2:29 AM, Peter van Hardenberg <pvh(at)pvh(dot)ca> wrote:
>> Ads and I were talking over breakfast about usability issues and he
>> mentioned transaction cancellation during interactive sessions as a serious
>> pain point.
>>
>> I suggest we update the default of ON_ERROR_ROLLBACK to interactive for
>> 10.0.
>>
>> The last discussion I could find about this subject was in 2011 and while
>> there was concern about setting the default to "on" (as this would tamper
>> with the expected behaviour of scripts), I don't see any identification of a
>> problem that would be caused by setting it to "interactive" by default.
> Well, then you'd get one behavior when you use psql interactively, and
> another behavior when you use it from a script. And if you used a
> client other than psql the behavior would be different from psql.
> Plus, it's kinda surprising to have a client that, by default, is
> sending secret commands to the server that you don't know about. And
> it's a backward-incompatible change against previous releases. I
> don't think any of that makes this the worst idea ever, but on balance
> I still think it's better to just recommend to people that they
> configure their .psqlrc with this setting if they want the behavior.

I'm not entirely convinced that psql should behave the same way no
matter how it is started.
Usually I put a \set ON_ERROR_STOP on the top of my scripts - something
I never do in interactive mode, just too lazy for that. Behaviour is
just different if I use psql in script mode.
Also if you paste something, you are still using it interactive - you
could as well just \i the script file.

However I agree that should be something which is announced, and maybe
changed a release later.

After further discussion, Peter will propose another solution soon.

--
Andreas 'ads' Scherbaum
German PostgreSQL User Group
European PostgreSQL User Group - Board of Directors
Volunteer Regional Contact, Germany - PostgreSQL Project

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Kapila 2017-03-16 11:34:23 Re: Microvacuum support for Hash Index
Previous Message Ashutosh Bapat 2017-03-16 11:19:49 Re: Partition-wise join for join between (declaratively) partitioned tables