pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Laurenz Albe <laurenz.albe@cybertec.at>
To: Jeremy Schneider <schnjere@amazon.com>
To: pgsql-general@lists.postgresql.org <pgsql-general@lists.postgresql.org>
Subject: Re: survey: psql syntax errors abort my transactions
Date: Fri, 03 Jul 2020 08:54:22 +0200
Message-ID: <658a910b8a785a859f651102798ead5c851d8034.camel@cybertec.at> (raw)
In-Reply-To: <d3914fb6-6777-e532-fa4a-024672914cbc@amazon.com>
References: <d3914fb6-6777-e532-fa4a-024672914cbc@amazon.com>

On Thu, 2020-07-02 at 08:54 -0700, Jeremy Schneider wrote:
> Maybe it's just me, but I'm wondering if it's worth changing the default behavior
> of psql so it doesn't abort transactions in interactive mode when I mistakenly
> mis-spell "select" or something silly like that.
> This is of course easily remedied in my psqlrc file by adding "\set ON_ERROR_ROLLBACK interactive".
> [...]
> But I do know that for all the new people coming to PostgreSQL right now
> (including lots at my company), none of them are going to know about this setting
> and personally I think the default is user-unfriendly.
> [...]
>
> So...
> 
> Survey for the user community here on the pgsql-general list: it would be great if lots
> of people could chime in by answering two questions about your very own production environment:
> 
> question 1) are you worried about scripts in your production environment where damage
> could be caused by a different default in a future new major version of postgresql?
> not aborting transactions in interactive mode when syntax errors occur)

I would dislike if interactive mode behaves differently from a non-interactive mode.

This is my favorite example why I like the way PostgreSQL does things:

/* poor man's VACUUM (FULL) */
BEGIN;
CREATTE TABLE t2 AS SELECT * FROM t1;
DROP TABLE t1;
ALTER TABLE t2 RENAME TO t1;
COMMIT;

> question 2) do you think the increased user-friendliness of changing this default
> behavior would be worthwhile for specific users in your organization who use postgresql?
> (including both yourself and others you know of)

I personally would benefit because I wouldn't have to repeat the whole transaction
while teaching a class when I made a typo inside a transaction.

Still I prefer the way things are currently.  Teaching classes is not the main
use case of psql.

Yours,
Laurenz Albe






view thread (12+ messages)  latest in thread

Message-ID: <658a910b8a785a859f651102798ead5c851d8034.camel@cybertec.at>
Permalink:  ../658a910b8a785a859f651102798ead5c851d8034.camel@cybertec.at/
Also on:    postgresql.org/message-id/658a910b8a785a859f651102798ead5c851d8034.camel@cybertec.at

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: laurenz.albe@cybertec.at, schnjere@amazon.com
  Subject: Re: survey: psql syntax errors abort my transactions
  In-Reply-To: <658a910b8a785a859f651102798ead5c851d8034.camel@cybertec.at>
  References: <d3914fb6-6777-e532-fa4a-024672914cbc@amazon.com> <658a910b8a785a859f651102798ead5c851d8034.camel@cybertec.at>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox