Re: Nested xacts: looking for testers and review - Mailing list pgsql-hackers

From Stephan Szabo
Subject Re: Nested xacts: looking for testers and review
Date
Msg-id 20040530035204.U51879@megazone.bigpanda.com
Whole thread Raw
In response to Re: Nested xacts: looking for testers and review  (Alvaro Herrera <alvherre@dcc.uchile.cl>)
Responses Re: Nested xacts: looking for testers and review
List pgsql-hackers
On Sat, 29 May 2004, Alvaro Herrera wrote:

> On Sat, May 29, 2004 at 08:25:27AM -0700, Stephan Szabo wrote:
>
> > BTW: For the deferred trigger stuff, I am guessing you haven't touched
> > that at all in the current patch?
> >
> > I wonder if the following would work assuming that we want deferred
> > triggers to run at outer transaction end?
>
> Ah, this seems to work.  I'll implement it and I'll let you know how it
> goes.

Ugh... There's one further wrinkle I hadn't thought about, imagine the
following:

begin;-- here the transaction does something that makes deferred trigger-- entriesbegin; set constraints all immediate;
--we now run through doing the deferred trigger itemsrollback;-- we need to unmark that the deferred items from the--
outertransaction have been run.  However, in general,-- it might not be all entries nor all entries that are marked--
asdone.
 

I'm not sure how expensive it is to check if a given subxact has
committed, but maybe instead of just done/not done, we need to say
something like what xid marked the trigger and instead of

if (!(event->dte_event & (TRIGGER_DEFERRED_DONE |
TRIGGER_DEFERRED_CANCELED)))

inside deferredTriggerInvokeEvents we do something like:

if (!((event->dte_event & (TRIGGER_DEFERRED_DONE |
TRIGGER_DEFERRED_CANCELED)) && /*something to check that the marking xact
is either myself or a committed subxact*/))



pgsql-hackers by date:

Previous
From: Oliver Jowett
Date:
Subject: v3 protocol & string encoding
Next
From: Shridhar Daithankar
Date:
Subject: Converting postgresql.conf parameters to kilobytes