Re: [BUGS] BUG #14808: V10-beta4, backend abort - Mailing list pgsql-bugs

From Tom Lane
Subject Re: [BUGS] BUG #14808: V10-beta4, backend abort
Date
Msg-id 13984.1505157880@sss.pgh.pa.us
Whole thread Raw
In response to Re: [BUGS] BUG #14808: V10-beta4, backend abort  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-bugs
Robert Haas <robertmhaas@gmail.com> writes:
> On Sat, Sep 9, 2017 at 1:08 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> My first instinct is to get rid of DestroyTransitionCaptureState
>> altogether, on the grounds that the TransitionCaptureState will
>> go away at transaction cleanup and we can't really get rid of it
>> any sooner than that.

> End of transaction, or end of query?  I'm not sure what happens when
> triggers are deferred, but I think there are a lot of cases when we
> want to throw away the tuplestore immediately, not hold on to it for
> the rest of the transaction.

As things stand, it's end of subtransaction, because the TCSes
are allocated in CurTransactionContext.  See the argument in
MakeTransitionCaptureState.

And yes, this is inefficient.  The quick-hack patch I committed yesterday
only pays the price if you have RI triggers cascading changes into a table
that also has triggers-with-transition-tables, but I can certainly believe
that it could get expensive in such a case.

The fix proposal discussed downthread should fix the inefficiency as well
as the spec compliance problem.  But personally I'm far more worried about
the latter.
        regards, tom lane


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs

pgsql-bugs by date:

Previous
From: Robert Haas
Date:
Subject: Re: [BUGS] BUG #14808: V10-beta4, backend abort
Next
From: serovov@gmail.com
Date:
Subject: [BUGS] BUG #14811: Nested IN SUBQERY that returns empty results executedmultiple times.