Re: BUG #14808: V10-beta4, backend abort

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>, phb07 <phb07(at)apra(dot)asso(dot)fr>, Thomas Munro <thomas(dot)munro(at)enterprisedb(dot)com>, Andrew Gierth <rhodiumtoad(at)postgresql(dot)org>, PostgreSQL mailing lists <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: BUG #14808: V10-beta4, backend abort
Date: 2017-09-11 19:24:40
Message-ID: 13984.1505157880@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Robert Haas <robertmhaas(at)gmail(dot)com> writes:
> On Sat, Sep 9, 2017 at 1:08 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)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

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message serovov 2017-09-11 21:26:48 BUG #14811: Nested IN SUBQERY that returns empty results executed multiple times.
Previous Message Robert Haas 2017-09-11 19:17:44 Re: BUG #14808: V10-beta4, backend abort