Re: savepoint improvements

From: Martijn van Oosterhout <kleptog(at)svana(dot)org>
To: Merlin Moncure <mmoncure(at)gmail(dot)com>
Cc: Simon Riggs <simon(at)2ndquadrant(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Jaime Casanova <systemguards(at)gmail(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: savepoint improvements
Date: 2007-01-22 18:33:54
Message-ID: 20070122183354.GE29762@svana.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)svana(dot)org> http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Dawid Kuroczko 2007-01-22 18:37:52 Re: savepoint improvements
Previous Message Bruce Momjian 2007-01-22 18:33:14 Re: [HACKERS] Win32 WEXITSTATUS too