Re: [GENERAL] undefined behaviour for sub-transactions?
Michael Fuhr <[email protected]>
| Newsgroups | gmane.comp.db.mysql.perl,gmane.comp.lang.perl.modules.dbi.general,gmane.comp.db.postgresql.general |
|---|---|
| Message-ID | <[email protected]> |
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
--
MySQL Perl Mailing List
For list archives: http://lists.mysql.com/perl
To unsubscribe: http://lists.mysql.com/[email protected]