Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iIeB9-0000sM-C5 for pgsql-general@arkaria.postgresql.org; Thu, 10 Oct 2019 19:32:51 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iIeB7-0000kp-UN for pgsql-general@arkaria.postgresql.org; Thu, 10 Oct 2019 19:32:49 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iIeB7-0000kd-GQ for pgsql-general@lists.postgresql.org; Thu, 10 Oct 2019 19:32:49 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1iIeB0-0003wA-UG for pgsql-general@lists.postgresql.org; Thu, 10 Oct 2019 19:32:48 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id x9AJWc3H022777; Thu, 10 Oct 2019 15:32:39 -0400 From: Tom Lane To: Andres Freund cc: Andreas Joseph Krogh , pgsql-general@lists.postgresql.org Subject: Re: Segmentation fault with PG-12 In-reply-to: <877e5duq7t.fsf@alap4.lan> References: <877e5duq7t.fsf@alap4.lan> Comments: In-reply-to Andres Freund message dated "Wed, 09 Oct 2019 22:25:26 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <22775.1570735958.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Thu, 10 Oct 2019 15:32:38 -0400 Message-ID: <22776.1570735958@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Andres Freund writes: > On 2019-10-09 10:16:37 -0400, Tom Lane wrote: >> Well, it shows that the failure is occurring while trying to evaluate >> a variable in a trigger's WHEN clause during >> "UPDATE origo_email_delivery SET folder_id=3D$1, created=3D$2\nWHERE en= tity_id IN ($3)\nRETURNING entity_id" >> And I'd bet that the root cause is something to do with Andres' tuple s= lot >> work. But (at least to my eye) it's not apparent exactly what's wrong. > It looks like this could "just" be another report of #16036, which was > already fixed in: > commit d986d4e87f61c68f52c68ebc274960dc664b7b4e > Author: Andres Freund > Date: 2019-10-04 11:59:34 -0700 > Fix crash caused by EPQ happening with a before update trigger prese= nt. Bingo. I can reproduce the crash (using concurrent updates of the same table row, in the schema Andreas sent off-list) on the predecessor of that commit, but on that commit it's fine. Andreas, that's a pretty simple patch if you're in a position to build from source ... regards, tom lane