Re: savepoint improvements

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>
Cc: Simon Riggs <simon(at)2ndquadrant(dot)com>, Merlin Moncure <mmoncure(at)gmail(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: savepoint improvements
Date: 2007-01-21 18:45:00
Message-ID: 28187.1169405100@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

"Joshua D. Drake" <jd(at)commandprompt(dot)com> writes:
> At a minimum we need to stop forcing a rollback just because we have a
> syntax error. It makes development a complete pain in the butt and is
> one of the most, "WTF" looks I get when I am training.

> postgres=# begin;
> BEGIN
> postgres=# create table foo (bar ints);
> ERROR: type "ints" does not exist
> postgres=# create table foo (bar int);
> ERROR: current transaction is aborted, commands ignored until end of
> transaction block
> postgres=#

ON_ERROR_ROLLBACK is what you are looking for.

regression=# \set ON_ERROR_ROLLBACK on
regression=# begin;
BEGIN
regression=# create table foo (bar ints);
ERROR: type "ints" does not exist
LINE 1: create table foo (bar ints);
^
regression=# create table foo (bar int);
CREATE TABLE
regression=# commit;
COMMIT
regression=#

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Jim C. Nasby 2007-01-21 20:26:25 Re: [HACKERS] Autovacuum Improvements
Previous Message Joshua D. Drake 2007-01-21 18:37:45 Re: savepoint improvements