Skip site navigation (1) Skip section navigation (2)

Continue transactions after errors in psql

From: Greg Sabino Mullane <greg(at)turnstep(dot)com>
To: pgsql-patches(at)postgresql(dot)org
Subject: Continue transactions after errors in psql
Date: 2005-01-26 03:07:54
Message-ID: 1106708873.24449.2.camel@localhost.localdomain (view raw or flat)
Thread:
Lists: pgsql-hackerspgsql-patches
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
 
 
Attached is a patch that takes advantage of savepoints to enable
transactions to continue even after errors in psql. The name of it
is \reseterror, and it is off by default. It's backwards compatible,
and allows things like this to work on 8.0 and up servers:
 
\reseterror
BEGIN;
DELETE FROM foobar;
INSERT INTO foobar(a) VALUES(1);
ISNER INTO foobar(a) VALUES(2);
INSERT INTO foobar(a) VALUES(3);
COMMIT;
 
Doing a SELECT(a) FROM foobar will show two values, 1 and 3. This
is a great help for those of us that tend to type typos into our
psql session, and end up cursing as we have to restart our current
transaction. :)
 
- --
Greg Sabino Mullane greg(at)turnstep(dot)com
PGP Key: 0x14964AC8 200501252203
http://biglumber.com/x/web?pk=2529DF6AB8F79407E94445B4BC9B906714964AC8
-----BEGIN PGP SIGNATURE-----
 
iD8DBQFB9wlpvJuQZxSWSsgRAsAzAKCxQ/JtR6/RXgV39uDTm9FIxCIp8QCeKC6T
2l10ef5DHkmFC2dSMQLNHjg=
=HKv9
-----END PGP SIGNATURE-----


Attachment: reseterror.diff
Description: text/x-patch (6.9 KB)

Responses

pgsql-hackers by date

Next:From: Christopher BrowneDate: 2005-01-26 03:46:56
Subject: Re: OLS BOF for linux & postgresql
Previous:From: Neil ConwayDate: 2005-01-26 02:30:23
Subject: Re: Concurrent free-lock

pgsql-patches by date

Next:From: Neil ConwayDate: 2005-01-26 08:28:03
Subject: Re: add soundex difference function to contrib/fuzzystrmatch
Previous:From: Stephen FrostDate: 2005-01-26 01:52:14
Subject: Re: [PATCHES] Merge pg_shadow && pg_group -- UNTESTED

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group