On Tue, Sep 27, 2011 at 7:57 PM, Will Leinweber <will(at)heroku(dot)com> wrote:
> I ruined a 5 hour UPDATE by typoing a table name on a SELECT to verify
> the update worked. I suppose I have no one else to blame, but it was
> really frustrating, to say the least. I assume this has happened to
> others as well.
> I only later found out about SAVEPOINT, which I immediately ran the
> next time I attempted the huge update.
> psql console, while in a transaction, and while in interactive mode,
> should savepoint for me.
I guess it would be a neat feature to have this in Postgres rather than in
psql. That is, if running in an explicit transaction (one started with
BEGIN), issue a savepoint after/before every command and emit the savepoint
name in a NOTICE.
I *think* savepoints are detrimental to performance, maybe under certain
pre-conditions, so it might be desirable to control it using a user-settable
If there's no perceivable performance difference in using savepoints even
under large transactions, then we might want to make it all automatic and
transparent. So Postgres issues a savepoint before every command, and if the
command fails, rollback to that savepoint, else release that savepoint.
The Enterprise PostgreSQL Company
In response to
pgsql-hackers by date
|Next:||From: Marko Tiikkaja||Date: 2011-09-28 17:39:59|
|Subject: Re: feature request: auto savepoint for interactive psql
when in transaction.|
|Previous:||From: Bruce Momjian||Date: 2011-09-28 16:48:28|
|Subject: Re: fix for pg_upgrade|