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

From Joel Jacobson
Subject [HACKERS] \set AUTOROLLBACK ON
Date
Msg-id CAASwCXc3v9ErsVHcr+O6UwKS3M-7WRi+3yb4qKXE44MO6cXwjw@mail.gmail.com
Whole thread Raw
Responses Re: [HACKERS] \set AUTOROLLBACK ON
List pgsql-hackers
Hi hackers,

A colleague of mine wondered if there is a way to always run
everything you type into psql in a db txn and automatically rollback
it as soon as it finish.
I couldn't think of any way to do so, but thought it would be a nice
feature and probably quite easy to add to psql, so I thought I should
suggest it here.

The typical use-case is you are doing something in production that you
just want to
a) test if some query works like expected and then rollback
or,
b) read-only queries that should not commit any changes anyway, so
here the rollback would just be an extra layer of security, since your
SELECT might call volatile functions that are actually not read-only

Thoughts?

/Joel



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: [HACKERS] A mistake in a comment
Next
From: Andrew Dunstan
Date:
Subject: Re: [HACKERS] intermittent failures in Cygwin from select_paralleltests