Re: [HACKERS] \set AUTOROLLBACK ON - Mailing list pgsql-hackers

From Joel Jacobson
Subject Re: [HACKERS] \set AUTOROLLBACK ON
Date
Msg-id CAASwCXeVPiJnkKJTqDtyQAKw2EW+=5Gy+DAAdB9ZhyjJa=zVhw@mail.gmail.com
Whole thread Raw
In response to Re: [HACKERS] \set AUTOROLLBACK ON  ("David G. Johnston" <david.g.johnston@gmail.com>)
List pgsql-hackers
On Mon, Jun 26, 2017 at 9:35 PM, David G. Johnston
<david.g.johnston@gmail.com> wrote:
> We already have SET TRANSACTION READ ONLY.

But in my use-case I am OK with the query doing write operations,
since sometimes you need to test something in prod (that cannot be
tested easily locally) but you want to ROLLBACK the query as quickly
as possible to avoid locking things longer than necessary. Currently
I'm just manually appending "; rollback;" to the query to make sure
its rollbacked.

The best thing I can do today is to map some button on the keyboard to
automatically type "; rollback; [enter]" instead of hitting [enter] to
fire-off the query, but it would be nice if it was built-in psql so
you could never commit something by mistake unless you explicitly exit
the AUTOROLLBACK mode.



pgsql-hackers by date:

Previous
From: Amit Kapila
Date:
Subject: Re: [HACKERS] Pluggable storage
Next
From: Albe Laurenz
Date:
Subject: [HACKERS] Typo in comment in postgres_fdw.c