Re: Nested transactions: low level stuff
Who wants subtransactions with UNDO and who wants it with a separate
transaction id for every subtransaction?
I think there is at least one special case, that would largely profit
from UNDO (or some other identical mechanism), namely an insert that
causes a constraint violation.
The standard way to program an "insert or update" is to do the one command
that will succeed in more cases first, then on failure do the other.
In PG this currently has to be done inefficiently by first doing the update
and then doing the insert. If we had implicit subtransactions, I think people
would start using the standard approach. It would probably not be too nice if
that would always leave dead tuples and index entries around.
Andreas
In fact, I had proposed a simpler UNDO capability that revisited tuples
and set their XID to a fixed aborted XID to clean up aborted
subtransactions, but most now like the multiple XID solution.
I think for the implicit subtransactions that we will want
(with error codes comming) using a different xid for every command
inside a transaction is not so sexy, no ?
Andreas
Import Notes
Resolved by subject fallback