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 1wcQ3j-003KpA-1j for pgsql-hackers@arkaria.postgresql.org; Wed, 24 Jun 2026 16:02:40 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wcQ3h-001cGB-0y for pgsql-hackers@arkaria.postgresql.org; Wed, 24 Jun 2026 16:02:37 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wcQ3g-001cG2-22 for pgsql-hackers@lists.postgresql.org; Wed, 24 Jun 2026 16:02:37 +0000 Received: from mail-pj1-x1030.google.com ([2607:f8b0:4864:20::1030]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1wcQ3e-000000003AI-1AWp for pgsql-hackers@postgresql.org; Wed, 24 Jun 2026 16:02:35 +0000 Received: by mail-pj1-x1030.google.com with SMTP id 98e67ed59e1d1-37cae11ba85so961314a91.1 for ; Wed, 24 Jun 2026 09:02:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1782316953; cv=none; d=google.com; s=arc-20240605; b=AmPEBnxrIMnWcEU3PtCmzzO7SJ50+2FkNiSHs5YYSC9JxNwsykN5LnWHX1k+X7D8jO JDk8RNu8HubhqGhyn3ws5DUDWEcNwL7yFbxIuj58rn3QyiWP0HmMaDB89Vd1+TnhaNeo E22uL/TCCYxQOfNkTrAFnOv0j+FFCG0lV4DYaqUSMGEr5UEJLJbGX0hU8mGWWdZdLu1+ TBnr4JWA4tbcwz/ZZmpm4tb685b/uzSWh8xixyD/ZTIUq+tu5XMVryVOGZx7i7OCHd6v XAfYUXvIgFTh5iWXiyN8dO+631S/gDfHhBksRzHlN9ZS0zAtI1j1bkZMTS/P1BjsXlrq 03/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=Myv7ri2UeqJWarqW3kgK3h1N8aRApoL2oGAaZCuH+7Q=; fh=F1WMhepPFSOAULsun6DiJh9XGwPhExLErw5m0/5+gUA=; b=JrYLVUeRPmTLvxgeFMwpAkZNsKHrxtxe7eOeMz4RSqrDkf3GggHY08wk4ccQSI6HIF geXCnbgRaXtKkm/9sIXFRMWI/TDTbBh+YSQgE0xBE2qwdYB2YzMyIWCYkAX4Wt9Deom+ +Yt4loSmc/xSyxBa7sCZJ8gHg7BcRXkKiOS44URklhiX9joyIz1NqUA+gfEC1tTf0Fz2 Aj0JO5fHlY1Gh+cEfxRnhaLmybIh920E+6iEqMH7y0jTZZOLLDtE1IUBDZJUcCn0psN3 kU/kFoHoDwe0AuppiBqSJxmgQ/q/X+V5i283+MOZSTW8FF/pEam4AZd0isAiRoI8niq/ gihQ==; darn=postgresql.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=illuminatedcomputing-com.20251104.gappssmtp.com; s=20251104; t=1782316953; x=1782921753; darn=postgresql.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=Myv7ri2UeqJWarqW3kgK3h1N8aRApoL2oGAaZCuH+7Q=; b=u7pvmoe59WAkeFpOYfbY+JPI0KAXZsy7Z+2sJZXZqv6IqTaidiCFGskoq7denqSHit WJCdsVdy8gk7twXVk2JYTFC47FUmj/LpFzRm9NFMFp6aOfFk3bZHf/n3QUaej6Ennbvj iMTpeRVixBo+WLQaOdy8ASc88I9GHm05axL7XOVNeABfP6w+EsrjiO8m1LxrFqUDsdg0 rgtbGWxGeE1dBqdV9+beLNhfzuj8sxBTV2QUYA1NyuGNszijwmTCwlUDKjkhjq4kh4HK 07qmkRAnMokPGIlngPetzWLlBBftws/qIeW4Obe4ZAoYEn8GB30rYTLuYOUpXZhiYKK0 OwIA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1782316953; x=1782921753; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=Myv7ri2UeqJWarqW3kgK3h1N8aRApoL2oGAaZCuH+7Q=; b=fpRmxT9TN+KgDKyiUZ+URPCrxXUawKi1MvbikrOvhlo6L6Pm/Yz4eTv+Br1eDAfz1U xbKno1VLM2ghb946IWgMD+kSgr2wr4AuDdn7IYFH8hEO9ef6lvZX9vLQVYKjrCfCurlX Utb7W3JUIlElEiuIdb0AH7ElfP/Zj1gKhDCCoQ8pcQRXF31t0l1M287bgeGT8IHR0VA4 QDgC16Nu3Jr1xd8XhUiGZJmOD+OC6G87ZL3yj1NhKSzsy7TZlIhqobC9+bdbfHlOQK0U E5ce3jlIBXcclC/bLwpMXy9RFptpbyssPlOpl78Aylo4xx6FrWxMhaZeuq8btsSA/GG/ ITPA== X-Gm-Message-State: AOJu0Yz+/v1HGzF6rcrekzFpeqUpygJQVDTWgG8St8Arc5sCqMvWo8hd q7Fulomu+cEt5hML81jfzxdoa8crHfI1RT5uuWvEYcBXp5rlqRY5FFQletjejvbVCPh0YpEqObP /ylf1FAAeYOBb/UMInC0RSwFhNBMJm9gIiATR2OzzjA== X-Gm-Gg: AfdE7clrYRWxeQTkBIa2dpA7W5bKLTZeM4IFjjbcqWY5HFmUraQeRSCBgihaHIDU9Yg aNRvgYIIxkBAdc/hbywh9dInKbH7b4Ew1DdY+f1CYOcTchF48LQyGY4usAJTz9Asfv96xPcL5IY c4huifVx9jEZnYsfUjfOpvSjObpePP6htDwA/Kna0scbnJO4JN+EmIaNTWn2+k1XaBawNoKVELj 3f5Uox+bq0tER8qzYH7dGgl2d6/E/o9iVgsXGnSBcg0hm8ADZl5sGS1SmvRkTISLJ1QyPm4 X-Received: by 2002:a17:90b:184e:b0:377:36af:c996 with SMTP id 98e67ed59e1d1-37de4295b47mr4737646a91.21.1782316952928; Wed, 24 Jun 2026 09:02:32 -0700 (PDT) MIME-Version: 1.0 References: <626986.1776785090@sss.pgh.pa.us> <84f20d0d-3bc8-4843-bd7e-21bce20f8582@eisentraut.org> In-Reply-To: From: Paul A Jungwirth Date: Wed, 24 Jun 2026 09:02:21 -0700 X-Gm-Features: AVVi8CfMRKBwvJW-YtJ3ktpgCyszK3jchuLeNlzSVPwQxMf-NPbS14aVrBShy4c Message-ID: Subject: Re: [PATCH] Fix null pointer dereference in PG19 To: Aleksander Alekseev Cc: PostgreSQL Development , Tom Lane , Peter Eisentraut , jian he Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Wed, Jun 24, 2026 at 4:13=E2=80=AFAM Aleksander Alekseev wrote: > > Hi Peter, > > Thanks for your attention to this. > > > I don't understand the status of this discussion. The original bug > > report is related to views and INSTEAD OF triggers. But the last few > > patches that have been posted here appear to be unrelated to that > > specific issue. > > That makes two of us. My humble understanding is that there are > several related discussions but they are happening elsewhere now. Feel > free correcting me if this is not the case. I agree it is confusing. A lot of things were originally reported on unrelated threads. I've been making separate threads for each issue+patch and trying to steer discussion there. I'd like to keep this thread limited to the original issue reported by Aleksander: that we crash trying to insert temporal leftovers on a view with an INSTEAD OF trigger. One thing confusing about this bug is that it was reported twice. The first time was here: https://www.postgresql.org/message-id/CAHg+QDd74fnd4obCRMqVS0AVWf=3DcSFH=3D= Cv7trTJWgm+_bhTK6w@mail.gmail.com But since that was on the original development thread, I thought this thread was a better place to continue discussion. The Open Items page should point to the right thread for each issue. But I see that for this issue, it points to the original bug report, so you have to click through a lot of messages to wind up in the right place. I'll update the link to come here. > Here I propose to focus on a particular crash and the particular > proposed bugfix, v1-0001. Perhaps it should be rewritten or maybe we > should reject it in favor of another patch. Both are possible > outcomes. Right now I'm only interested in fixing a particular crash. I don't think forbidding INSTEAD OF triggers with FOR PORTION OF is the right solution. It seems too heavy-handed. But we *should* skip trying to insert temporal leftovers. After all if you did something *instead of* the update/delete, we can't know what the leftovers should be. Or another way of putting it: the trigger function runs instead of the original command, but inserting leftovers is part of that original command. Skipping temporal leftovers is implemented in my v5 patch on this thread from April 22: https://www.postgresql.org/message-id/CA%2BrenyUoTRnn0o4Pnfy2AOdtqMH3%2Bn29= _AfD4Aih3ifwMX9vyA%40mail.gmail.com > > I definitely don't like checking volatility at parse time, though. > > So.... the last comment from Tom was that he is not happy :) but I'm > not sure about the actionable items. Tom, could you please elaborate a > bit? Here is the thread for moving checks out of analysis: https://www.postgresql.org/message-id/CA%2BrenyUte0_UJsJiDJQi82oaBsMJn%3Dcc= t0Wn%3DvOqXtuDn%3DYYJA%40mail.gmail.com Yours, --=20 Paul ~{:-) pj@illuminatedcomputing.com