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

Re: feature request: auto savepoint for interactive psql when in transaction.

From: Stephen Frost <sfrost(at)snowman(dot)net>
To: Kevin Grittner <Kevin(dot)Grittner(at)wicourts(dot)gov>
Cc: Alvaro Herrera <alvherre(at)commandprompt(dot)com>,Will Leinweber <will(at)heroku(dot)com>,Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: feature request: auto savepoint for interactive psql when in transaction.
Date: 2011-09-28 19:22:58
Message-ID: 20110928192258.GZ12765@tamriel.snowman.net (view raw or flat)
Thread:
Lists: pgsql-hackers
* Kevin Grittner (Kevin(dot)Grittner(at)wicourts(dot)gov) wrote:
> Alvaro Herrera <alvherre(at)commandprompt(dot)com> wrote:
> > See ON_ERROR_ROLLBACK
> > http://www.postgresql.org/docs/9.0/static/app-psql.html
>  
> I had missed that.  Dang, this database product is rich with nice
> features!  :-)

Be careful when running scripts, however..  Any invocation of psql will
read you .psqlrc and if you've got ON_ERROR_ROLLBACK set there then
psql -f blah ; will pick up on that and you'll end up running every
command in the script (including the commit at the end...), even if some
of the commands in it failed.

So, if you put it in your .psqlrc, be VERY sure that you UN-set it on
the command-line whenever running SQL scripts which *should* rollback on
failures..

	Thanks,

		Stephen

In response to

Responses

pgsql-hackers by date

Next:From: Alvaro HerreraDate: 2011-09-28 19:49:54
Subject: Re: feature request: auto savepoint for interactive psql when in transaction.
Previous:From: David FetterDate: 2011-09-28 18:47:51
Subject: Re: feature request: auto savepoint for interactive psql when in transaction.

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