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 1wRuQ9-002nYq-1m for pgsql-hackers@arkaria.postgresql.org; Tue, 26 May 2026 16:14:21 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wRuQ7-005Auv-1S for pgsql-hackers@arkaria.postgresql.org; Tue, 26 May 2026 16:14:20 +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 1wRuQ7-005Aun-08 for pgsql-hackers@lists.postgresql.org; Tue, 26 May 2026 16:14:20 +0000 Received: from mail-oo1-xc36.google.com ([2607:f8b0:4864:20::c36]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1wRuQ5-00000001Xuo-2AdR for pgsql-hackers@lists.postgresql.org; Tue, 26 May 2026 16:14:19 +0000 Received: by mail-oo1-xc36.google.com with SMTP id 006d021491bc7-69d7c1e2a48so3288981eaf.1 for ; Tue, 26 May 2026 09:14:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1779812056; cv=none; d=google.com; s=arc-20240605; b=KKSz3Kytn4Tkr6w1ks5XFpNWojUo3gGQF+/NDbYvBZfw1mqYvp86vPFQt1KOh9AmU3 E4LVtK+hFH+xWJvAdxDIiSk/ZZ1dRWYQjFXDyUgXh9dKNIBemtYHMOTJHHF+Cuvl73eX XN5qFPMVaSmRGR27f+MHZFIvXksLBehzj+v+cL+a8v3bEqWDyYQA/gJFG4g0eraI+lC1 yDg07bGHEkhvHxjLLmEsr97YaR1Ob3e+y4HW5UiJgkbptV/9ml6Me0iQtkoUNjgKwrty 5WL3mrH6OIyhbaDnHZwzu3tVkLih4WPjQgXpzXPYHjLMDfHqQAuEZ7a+mobbg1Fkfe9d uBDw== 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=v7QSZYdGyH4aUj75JwdGShwc2v+/3sFZwrVEc1nbM6o=; fh=difWPyZhf+FMfWnUHiBJsrLSKQJL23D1+3HP+YAZNos=; b=GxutgbVeKkSC+P0WCPdBypA35kQxArppQT/R3tOQg27LT5R2tM12WyBqQWCB9BSlaU K5aIZfB6KW2vkzubmnNHTQ9xY7SYu5nxdNLXxewxpxqMwdtHX/tJPgr5xkzeBaNXyAAE tYhUfW5kMJ1lZ24F0gCjFg9wpUAaFm1bmNDYw9SujctCkNRXRrD2AsApqFeLnLjOKpXR F7seKNl6axH2AZZOQZTjhkWUzhyWcRzwOmgvgrtJBSwwT0/6N+6DllKo/MCITAe2+3Fv czuWpDH09uz2BGIJFYVL+0YUL0Eye/ZR2QmcQPScA8zSYf46YooWSBuU23o7FQ7zFcPT v3tg==; darn=lists.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=1779812056; x=1780416856; darn=lists.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=v7QSZYdGyH4aUj75JwdGShwc2v+/3sFZwrVEc1nbM6o=; b=R7wpvWZUHO274smEYTuOjJh4oNs86j3l42YY2cxEy1IUWudS59FCUR4ruc36GHFdrd T4FAXATqMm1by93o1LDX/PLqU4FXr3+RiDgTEgxnVU228lEEE0Qjj4WbRdC0NoRvpICQ VI3AoWj8eX/iRsxQmeRm3zQb1E64nLcYNt+oI1AtpzOQdCGmz3+GnS/K8K1DvpPddyMz +MchzZ30qX41HuiLwqUP+Z9KPeWdMDQpvmVnlEXb/F4+4CJJzfj+/znwx/8t7ihkqOnb LTs1Qx7xTrqkYIAuegKFuW9Qz5c+xoHHU8LbWsupjGIO8hjrj68JYFjiNsoAnPcJBG65 /oVQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1779812056; x=1780416856; 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=v7QSZYdGyH4aUj75JwdGShwc2v+/3sFZwrVEc1nbM6o=; b=ORg/lgxeoDuBYEPGVs198EFjILqFvymDtdVTgiUyJOVv032f9Tt/LxFNT164ZkDhSD wg8G6+wOvAQXvWR7D2lnbQfp1V/AdC23j+p33Hqse4YqYsHDZ/9ZLdGjqEM9KAB2+Sdg HTV9vTPLJXEzxMe3RCftwJfo9xZ15RqjlOsPFNTHPalGURjNF++yEJaxPPS5boONWY+N Z6CP3zUPwuNT8vlqtZYBrZ44NCWugvz/+5Um90fSRVWxld4HyyZ/nsbg9Na9PA3VW1Ew 8M0sG7bAiIpCkRl7pL8swrMvcJxtMdPIVUWXeWqeps0F/GA9O7WY4yoCYmeExy7SFJpj VFzw== X-Gm-Message-State: AOJu0YxRm57cw9K413gACpct12qavBE71VclFcTOzXg8EYFQy1I4iiDx C3Uf4RPr31pCEi8QFZ9X3VFszEVQfRjOwEQXRg2uqvi7XcZhwJp/+Prn1DcrKShjiW8w2eL8kNX onJRMRk4MvlSw1B+77kGT0nreajW4Abvln0OtLnIWtA== X-Gm-Gg: Acq92OHV282XG3zWCwFOwwTF/LOUhDq0poZVpuyp5w7wq1LLms3Rlzfa/NZvTagtBY7 FlaGzV2wFs68+SWNlVL4KB1aj3SwRxxzyGiaubjEXd6T4HJBgHJa6SuSYVjH40BsbKNaUiA/me2 5vlAujJqDPkVIXed2SKnNRN8iIonQOI4RaFi6DWSDNjW2VhUBocJfhwQfr1o/MX3qz8ASPrMB1t kEvV2Q3xc2r+p1+dkETWxWsftDqvUgVh9TEGgm8XlRcAho5FBzg7894b7XufSJRwLqtWB1yA+Nc RKy8 X-Received: by 2002:a05:6820:1b13:b0:69d:a256:83b5 with SMTP id 006d021491bc7-69da256868amr6941190eaf.56.1779812055807; Tue, 26 May 2026 09:14:15 -0700 (PDT) MIME-Version: 1.0 References: <4245F94D-84F1-4E05-BF81-C458A6CF9901@gmail.com> <260A544F-FBD6-40CC-9449-5987049DD2D4@gmail.com> In-Reply-To: From: Paul A Jungwirth Date: Tue, 26 May 2026 09:14:04 -0700 X-Gm-Features: AVHnY4LZNQJs5WF53QPYliVEhIpus26ALS0s5io-4hqF6DOVmXEhxZI703oIADk Message-ID: Subject: Re: Fix bug of UPDATE/DELETE FOR PORTION OF with inheritance tables To: Chao Li Cc: PostgreSQL Hackers 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 Mon, May 25, 2026 at 11:55=E2=80=AFPM Chao Li w= rote: > > Now v2 mixes two separate changes: > > 1) Adding ExecInitForPortionOf() to address the UPDATE OF trigger issue > 2) Fixing the inheritance/leftover bug originally reported in this thread > > I=E2=80=99d prefer not to combine these in a single patch. Could you plea= se split out the refactoring that adds ExecInitForPortionOf() into a separa= te patch, with tests showing that the UPDATE OF trigger issue is fixed? The= n I can rework my inheritance/leftover fix on top of that. Thanks for taking a look! I agree about keeping the fixes separate. UPDATE OF triggers are fixed by the patch on the other thread (with tests). Since we now include the application-time column in updatedCols, there is nothing else to do there. I thought the ExecInitForPortionOf refactoring was still nice to keep, and it seemed to fit better here. (I should have updated the commit message not to mention UPDATE OF though.) But thinking about it this morning, I realized: the planner already prunes partitions before we get here. Lazily initializing the structs is trying too hard. Is there some scenario where that actually saves work? If not, we could just set up all the structs in ExecInitModifyTable. That's what I was doing in an older version of the original patch. And then the refactor with ExecInitForPortionOf seems unnecessary. I'll send a patch with those changes, unless you have objections. (Probably two separate patches: one to remove lazy initialization, another to actually fix traditional inheritance.) If you disagree, please let me know. Yours, --=20 Paul ~{:-) pj@illuminatedcomputing.com