Re: Nested transactions: low level stuff - Mailing list pgsql-hackers

From Zeugswetter Andreas SB SD
Subject Re: Nested transactions: low level stuff
Date
Msg-id 46C15C39FEB2C44BA555E356FBCD6FA4961F70@m0114.s-mxs.net
Whole thread Raw
In response to Nested transactions: low level stuff  (Manfred Koizar <mkoi-pg@aon.at>)
List pgsql-hackers
> 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



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: optimizer cost calculation problem
Next
From: "Zeugswetter Andreas SB SD"
Date:
Subject: Re: Nested transactions: low level stuff