Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1whHhR-0007xl-0a for pgsql-hackers@arkaria.postgresql.org; Wed, 08 Jul 2026 02:07:45 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1whHhP-004GkC-1m for pgsql-hackers@arkaria.postgresql.org; Wed, 08 Jul 2026 02:07:44 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1whHhP-004Gk4-0q for pgsql-hackers@lists.postgresql.org; Wed, 08 Jul 2026 02:07:44 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1whHhN-000000009Mv-11r3 for pgsql-hackers@postgresql.org; Wed, 08 Jul 2026 02:07:43 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.18.1/8.18.1) with ESMTP id 66827b8M1894793; Tue, 7 Jul 2026 22:07:37 -0400 From: Tom Lane To: Paul A Jungwirth cc: Peter Eisentraut , Aleksander Alekseev , PostgreSQL Development Subject: Re: [PATCH] Fix null pointer dereference in PG19 In-reply-to: References: <626986.1776785090@sss.pgh.pa.us> <84f20d0d-3bc8-4843-bd7e-21bce20f8582@eisentraut.org> <4984118e-0dc5-49a9-b279-fd0b707be8e0@eisentraut.org> <391a2845-105b-4048-a113-835c2742fea1@eisentraut.org> Comments: In-reply-to Paul A Jungwirth message dated "Tue, 07 Jul 2026 18:45:46 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-ID: <1894791.1783476457.1@sss.pgh.pa.us> Content-Transfer-Encoding: 8bit Date: Tue, 07 Jul 2026 22:07:37 -0400 Message-ID: <1894792.1783476457@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Paul A Jungwirth writes: > On Tue, Apr 21, 2026 at 8:24 AM Tom Lane wrote: >> Checking this at parse time is completely the wrong thing. >> The view could have gained (or lost) triggers by the time >> it's executed. > But INSTEAD OF triggers are selected in the rewriter, which uses the > same relcache snapshot as parse analysis. And a concurrent change > can't sneak in different triggers, because that causes a relcache > invalidation, so we redo the parse & rewrite phases. You have forgotten about views and rewrite rules. Those go to disk in post-parser form, and will be rewritten only at execution sometime later, *without* a re-parse. regards, tom lane