Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1gIn3g-0008OV-Ge for pgsql-general@arkaria.postgresql.org; Sat, 03 Nov 2018 03:57:12 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gIn3c-0005bG-8H for pgsql-general@arkaria.postgresql.org; Sat, 03 Nov 2018 03:57:08 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1gIn3b-0005b9-R6 for pgsql-general@lists.postgresql.org; Sat, 03 Nov 2018 03:57:07 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1gIn3Y-0007ey-JB for pgsql-general@lists.postgresql.org; Sat, 03 Nov 2018 03:57:05 +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 wA33uw91032193; Fri, 2 Nov 2018 23:56:58 -0400 From: Tom Lane To: Karsten Hilbert cc: Alvaro Herrera , pgsql-general@lists.postgresql.org Subject: Re: backend crash on DELETE, reproducible locally In-reply-to: <20181101160007.GJ2954@hermes.hilbert.loc> References: <20181101152723.zq2dtcgntmcmr4br@alvherre.pgsql> <18072.1541087036@sss.pgh.pa.us> <20181101160007.GJ2954@hermes.hilbert.loc> Comments: In-reply-to Karsten Hilbert message dated "Thu, 01 Nov 2018 17:00:07 +0100" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <32191.1541217418.1@sss.pgh.pa.us> Date: Fri, 02 Nov 2018 23:56:58 -0400 Message-ID: <32192.1541217418@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Karsten Hilbert writes: > On Thu, Nov 01, 2018 at 11:43:56AM -0400, Tom Lane wrote: >> Yeah, apparently we've passed a null OLD tuple to an RI_FKey_cascade_del >> trigger, which surely shouldn't happen. It'd be interesting to look at >> the set of triggers on this table. I don't entirely trust psql's \d >> to show us reality if there's something screwed up about the triggers, >> so in addition to \d output, could we see >> select * from pg_trigger where tgrelid = 'ref.auto_hint'::regclass; > [ pretty normal-looking trigger entries ] I was feeling baffled about this, but it suddenly occurs to me that maybe the bug fixed in 040a1df61/372102b81 explains this. If the particular tuple you're trying to delete predates the last ALTER TABLE ADD COLUMN operation on the table, then this bug would result in t_self getting set to "invalid", which'd cause AfterTriggerSaveEvent to save "ate_ctid1" as "invalid", which'd lead to a null tuple getting passed when the trigger eventually gets invoked. regards, tom lane