Re: undefined behaviour for sub-transactions? - Mailing list pgsql-general

From Michael Fuhr
Subject Re: undefined behaviour for sub-transactions?
Date
Msg-id 20051201182150.GA53238@winnie.fuhr.org
Whole thread Raw
In response to Re: undefined behaviour for sub-transactions?  (Greg Stark <gsstark@mit.edu>)
List pgsql-general
On Thu, Dec 01, 2005 at 01:04:52PM -0500, Greg Stark wrote:
> Where is Postgres at with psql using savepoints implicitly to wrap every
> client command btw? My single biggest pet peeve with Postgres is that setting
> autocommit off in psql is basically unusable because any typo forces you to
> start your transaction all over again.

Are you looking for 8.1's ON_ERROR_ROLLBACK?

test=> \set ON_ERROR_ROLLBACK interactive
test=> begin;
BEGIN
test=> create table foo (x integer);
CREATE TABLE
test=> roeiuqrepuqw;
ERROR:  syntax error at or near "roeiuqrepuqw" at character 1
LINE 1: roeiuqrepuqw;
        ^
test=> insert into foo values (123);
INSERT 0 1
test=> commit;
COMMIT
test=> select * from foo;
  x
-----
 123
(1 row)

--
Michael Fuhr

pgsql-general by date:

Previous
From: Jaime Casanova
Date:
Subject: Re: Question
Next
From: Richard Huxton
Date:
Subject: Re: 8.1, OID's and plpgsql