Re: Nested transactions: low level stuff

From: "Zeugswetter Andreas SB SD" <ZeugswetterA(at)spardat(dot)at>
To: "Bruce Momjian" <pgman(at)candle(dot)pha(dot)pa(dot)us>, "Hiroshi Inoue" <Inoue(at)tpf(dot)co(dot)jp>
Cc: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "Manfred Koizar" <mkoi-pg(at)aon(dot)at>, <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Nested transactions: low level stuff
Date: 2003-04-01 17:32:24
Message-ID: 46C15C39FEB2C44BA555E356FBCD6FA4961F70@m0114.s-mxs.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Browse pgsql-hackers by date

  From Date Subject
Next Message Zeugswetter Andreas SB SD 2003-04-01 17:38:23 Re: Nested transactions: low level stuff
Previous Message Tom Lane 2003-04-01 16:24:01 Re: optimizer cost calculation problem