From: Tom Lane <tgl@sss.pgh.pa.us>
To: Alvaro Herrera <alvherre@2ndquadrant.com>
Cc: cbw <cbwhitebu@gmail.com>
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: Backend stuck in tirigger.c:afterTriggerInvokeEvents forever
Date: Tue, 21 Apr 2020 11:37:08 -0400
Message-ID: <2725.1587483428@sss.pgh.pa.us> (raw)
In-Reply-To: <20200421151935.GA18772@alvherre.pgsql>
References: <20200421151935.GA18772@alvherre.pgsql>
Alvaro Herrera <alvherre@2ndquadrant.com> writes:
> On 2020-Apr-21, Tom Lane wrote:
>> A variant of that theory is that foreign key trigger firings are being
>> skipped in one case but not the other; but offhand I think those
>> optimizations only apply to update/delete cases not inserts. Anyway
>> that still requires some assumptions about moving parts that you
>> haven't shown us.
> I wonder if there are any funny interactions between trigger tuple
> acquisition and the ON CONFLICT stuff. The only thing that occurs to me
> to explain the fact that it only fails with the two stmts in the DO
> block is that the second insert can see rows as inserted by the same
> transaction.
Yeah, I'll bet a good deal that the use of ON CONFLICT is part of the
issue here. That can queue firings of the unique_key_recheck trigger,
but I'm too lazy to go figure out exactly when that happens or gets
optimized away. (AfterTriggerSaveEvent definitely does know about
optimizing it away in some cases...)
regards, tom lane
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-bugs@postgresql.org
Cc: tgl@sss.pgh.pa.us, alvherre@2ndquadrant.com, cbwhitebu@gmail.com, pgsql-bugs@lists.postgresql.org
Subject: Re: Backend stuck in tirigger.c:afterTriggerInvokeEvents forever
In-Reply-To: <2725.1587483428@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox