Re: \set AUTOROLLBACK ON

From: Joel Jacobson <joel(at)trustly(dot)com>
To: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
Cc: David Fetter <david(at)fetter(dot)org>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>, Lukas Gratte <lukas(at)trustly(dot)com>
Subject: Re: \set AUTOROLLBACK ON
Date: 2017-06-28 13:38:09
Message-ID: CAASwCXeVPiJnkKJTqDtyQAKw2EW+=5Gy+DAAdB9ZhyjJa=zVhw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Jun 26, 2017 at 9:35 PM, David G. Johnston
<david(dot)g(dot)johnston(at)gmail(dot)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.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Albe Laurenz 2017-06-28 13:53:25 Typo in comment in postgres_fdw.c
Previous Message Amit Kapila 2017-06-28 12:50:16 Re: Pluggable storage