proposal: give savepoints automatic roll up ability.

From: "Merlin Moncure" <merlin(dot)moncure(at)rcsonline(dot)com>
To: <pgsql-hackers(at)postgresql(dot)org>
Subject: proposal: give savepoints automatic roll up ability.
Date: 2005-08-09 20:57:22
Message-ID: 6EE64EF3AB31D5448D0007DD34EEB3417DD056@Herge.rcsinc.local
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Dear Hackers,
In the early days of savepoints (then nested transactions), it was
possible to push and pop sub-transactions in a kind of FIFO stack.
While the savepoint method certainly has its advantages, there are some
things I really miss about the old behavior, mostly because you had
finer grained control over failure behavior without resorting to client
side logic.

What about extending one of the current commands or adding a new command
that does the following:

If not in a transaction containing a savepoint, issue a warning or an
error.
If in a failed transaction containing a savepoint, rollback to the
specified (or last savepoint).
If in a valid transaction containing a savepoint, do a no-op.

esp=# begin;
BEGIN
esp=# savepoint x;
SAVEPOINT
esp=# foo;
ERROR: syntax error at or near "foo" at character 1
LINE 1: foo;
^
esp=# release x with rollback;
RELEASE
esp=# commit;
COMMIT; <-- not rollack
esp=#

ok. maybe this is another zany idea. but I really think it would be
useful for things like scripts under certain circumstances.

Merlin

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Sullivan 2005-08-09 21:57:27 Re: Solving the OID-collision problem
Previous Message Soeren Laursen 2005-08-09 20:54:49 Use of inv_getsize in functions