Re: savepoint improvements - Mailing list pgsql-hackers

From Martijn van Oosterhout
Subject Re: savepoint improvements
Date
Msg-id 20070122183354.GE29762@svana.org
Whole thread Raw
In response to Re: savepoint improvements  ("Merlin Moncure" <mmoncure@gmail.com>)
Responses Re: savepoint improvements  ("Merlin Moncure" <mmoncure@gmail.com>)
List pgsql-hackers
On Mon, Jan 22, 2007 at 11:21:12AM -0500, Merlin Moncure wrote:
> >\begin_nest
> >\commit_nest
> >\rollback_nest
>
> That would work if we could rollback conditionally on failure (like
> on_error_rollback but with definable beginning and ending points).  I

Sorry, "rollback conditionally on failure" isn't parsing for me. Can
you give some example of what you mean?

> still think we are hacking around limitations of savepoints but it
> would solve the scripting problem at least.  A general implementation
> on the server would benefit everybody.

I don't understand this either. Everything you can do with nested
transactions you can also do with savepoints, so I'm really not
understand what the limitations are?

Actually, looking at the savepoint documentation, it looks like there
is no way to say:

if transaction_state ok then release X
else rollback to X

Which is what a normal COMMIT does (sort of). This is very irritating
for scripting, so maybe a "COMMIT TO X" command would be auseful
addition?

Have a nice day,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.

pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: [GENERAL] Autovacuum Improvements
Next
From: "Dawid Kuroczko"
Date:
Subject: Re: savepoint improvements