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 1wCCss-001lH7-2k for pgsql-hackers@arkaria.postgresql.org; Mon, 13 Apr 2026 08:43:07 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wCCsq-005hSG-33 for pgsql-hackers@arkaria.postgresql.org; Mon, 13 Apr 2026 08:43:05 +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 1wCCsq-005hS8-28 for pgsql-hackers@lists.postgresql.org; Mon, 13 Apr 2026 08:43:05 +0000 Received: from mail-vk1-xa2b.google.com ([2607:f8b0:4864:20::a2b]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1wCCsp-00000000ny0-2Qyf for pgsql-hackers@lists.postgresql.org; Mon, 13 Apr 2026 08:43:05 +0000 Received: by mail-vk1-xa2b.google.com with SMTP id 71dfb90a1353d-56739adfa1aso3099689e0c.0 for ; Mon, 13 Apr 2026 01:43:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1776069781; cv=none; d=google.com; s=arc-20240605; b=W6+x7VaIPwr734mYQzSTX8DWaTLmSPNj8/GMY0bbZiJwMnw8gbo3SApUbDoxx6z77z 3ikJlQXsyuUZExHb2K3X/suGE6e1PLarDYS11cR8MgyzKYVxruim0gaxaZu4SMQRI5N6 FswTjFT5jgbf0EMBfL+5tC1JQKyI4WLesZuBcq+rDWYJqKo2EMbVqb3ORlF/PAMtpVX+ LMsrdbGMBjhm3ZkPwFRWadfbxkvA/hr0A6GKnimIaFnz66Kkv8N9hugGh80qtS4RZQ6O G09huBvFT9H2otI8BLg2FVKCQMD7XjnMm4ak0YvUCZBq3tMxBAVpgggXxYaMg63MYIhw bWcQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:dkim-signature; bh=Fis5TluIGEG9ZNhH4MmN/iR4BH2YERPhKPXiF2PAWuc=; fh=TqdjkZTAHTAfnuUmgL6GT3BrqipZBVZfBTHWSLAIo9A=; b=Ph0Ka/Sqt8IKI4zgltSkHtRG7TOvAMlEarmnzfi6Fg1zOt5seFNjTmf5aVNVZYnc4Z mJ+oU9Eu0/yVmrVQtsr/cyfebGESGyCjfpfrx8s7JDYbW8XG6TRWii9Bh7dVPCO9X5nv 8jRgMElTMrnSgOc9WoL7h7xwuRM50vTkk7lmIedPanwAlIIaOpH3ikoj+Mk1xIjPqyde oKgTX05ZYwHI94/RcSfwNhOuEEtZQoLVahEg2gtJWZBrnLTbrDIIMEuXwcbf3qWLnSPp 9kMoo7Nr+marVrXtBhBu+ece8Kzj+V84eMWVUGhbuwwYTp64tE/Sv2y3fr/cHQyDDsC3 l1CA==; 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=gmail.com; s=20251104; t=1776069781; x=1776674581; darn=lists.postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=Fis5TluIGEG9ZNhH4MmN/iR4BH2YERPhKPXiF2PAWuc=; b=J2bG2PdWXsxug+1Z+BfmLJkW+3wOCFeTFaywQppTjeNK6jLodBlbWVMtcaJjLYKVt4 nPqDA8nOZ99pgYdwOtmdQdDPE/OBfwtDqKy3xDVh3jeO/GUwdQZVEMlSzPcJDeE2JnrV VKtF3I1xDKW/nXIMiai98aatgtDEeelVbCx+VS2FRM0NrRKfhvAfsiC284Rey/Osqpti fWsecMjRoZ8Brtzqw8NL+LtH9dc53VArocdbn81ruH84shmHfhQKy1ogvmFTFznyR2Xa ZnoaVG0DVv4yge1wLM+z/1Qj9dEqOFW4Qalj28KudW0IBt2Q5duJbs/o6PSaYMF7Pckb mMlw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1776069781; x=1776674581; h=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=Fis5TluIGEG9ZNhH4MmN/iR4BH2YERPhKPXiF2PAWuc=; b=BHXktdHB015xCi89GuJ8pAjU+cWYnWaVggLxCaRnVBdOitwJEiD6DH2GJJzY0/wfgT tX1r8HhGJLaNagqgQwCYIaICX7Q50EjBXJcfYKUe3HaTt+sSTkTL8pt7RRQRXnUk4Rz8 SaWT89VdVh7uM7IpWrX4u05RfD4V5uza7JlNnEi8xoB4cUT3L2WNcTo+o2ASRAxaaQvP FsqM1UBKaxFnilGQSQlRf7EUqsc5sOM/S6RMwydDIA5Jg9vI1u6J+umsW7QULTkaYlaN CS92TopxL7c/TMl0i1JXury0JbUhIzdAnyUmMaSduuJEL+Jsdyk0Xroio6HD3IULX5Fg xQ0Q== X-Forwarded-Encrypted: i=1; AFNElJ9Ev/KXvtI5Ppit/la2UuhWHPDkQ7esIEC6RN/O7McTqXmJFCre67IbSSuzxK8JoSSl66qtKn5UsRvRoanP@lists.postgresql.org X-Gm-Message-State: AOJu0YyLjjRaOmi/bz4WaSRV1CT+YMOjgO1TRlHzIMvjzkBL6EGAeGNn A32/j4EPFRovM7v2m734rPaXWGMyRS27Xp91ZoxjlX4Tp3NZneHAJjwPut69mFYdV3nwCVVNqZK upkK4tN0MDGTHWvT4/eHL3aYQNNX2N8I= X-Gm-Gg: AeBDietKmZxJKMlSRtAyO8tpJT9Vl8GwbFqnUNnXj66uBCGastiggLTBYZJEwyS7lel y4CxjmhCurSFB3CbeOk/us5gWfs2DQYdwU+qcCL4WpSXc0DI3b72w6U95mNkNcC0aCIayuSF/ML sUOpULZOdnvDbRLCupWp8zMLPud2D/z22nH1Qj1eJrfAq7ZL54gLNTNxRxqGkQ2Xpt/AjV0Ulnh gz+9m1HiwhiG3Wn1nYb4zlBpKJMgg/ktwDG36HkkT5Gab1iLNl4VdvERvtvcM7GUCSWP4U1FfaM fQry2Fw= X-Received: by 2002:a05:6102:3f8f:b0:605:315f:49f7 with SMTP id ada2fe7eead31-609fecbdf5dmr5327287137.6.1776069781528; Mon, 13 Apr 2026 01:43:01 -0700 (PDT) MIME-Version: 1.0 References: <22B4A33A-99F3-46F5-BE0C-426A9E1D9ABA@gmail.com> In-Reply-To: From: SATYANARAYANA NARLAPURAM Date: Mon, 13 Apr 2026 01:42:49 -0700 X-Gm-Features: AQROBzANYTYaWySHf_ERJFmP7a2fpR6iP7a30lYsyRqUoAC4zNCqxIOPMErB0rU Message-ID: Subject: Re: Bug: Rule actions see wrong values for generated columns (NEW.gen reads OLD value) To: Richard Guo Cc: Chao Li , PostgreSQL Hackers , Peter Eisentraut Content-Type: multipart/alternative; boundary="0000000000006ca68c064f537890" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --0000000000006ca68c064f537890 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Richard, On Mon, Apr 13, 2026 at 1:30=E2=80=AFAM Richard Guo wrote: > On Mon, Apr 13, 2026 at 4:27=E2=80=AFPM SATYANARAYANA NARLAPURAM > wrote: > > On Mon, Apr 13, 2026 at 12:21=E2=80=AFAM Chao Li wrote: > >> Do either of you plan to propose a patch for this? If so, please go > ahead and I can review it. Otherwise, I can propose a patch in a couple o= f > days. > > > I have a patch with me, let me post it shortly. > > Please feel free to share your patches. I've been looking into this > as well, but I'd be happy to see independent takes on it. > I reviewed your patch, it looks good. I ran the tests you added and a few additional tests and they are passing. Please continue with your patch. Maybe a test like "WHERE NEW.b > threshold" to confirm the expansion happens before qual evaluation would be good. Thanks, Satya --0000000000006ca68c064f537890 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi Richard,

On Mon, = Apr 13, 2026 at 1:30=E2=80=AFAM Richard Guo <guofenglinux@gmail.com> wrote:
On Mon, Apr 13, 2026 at 4:27=E2=80=AFP= M SATYANARAYANA NARLAPURAM
<satyanar= lapuram@gmail.com> wrote:
> On Mon, Apr 13, 2026 at 12:21=E2=80=AFAM Chao Li <li.evan.chao@gmail.com> w= rote:
>> Do either of you plan to propose a patch for this? If so, please g= o ahead and I can review it. Otherwise, I can propose a patch in a couple o= f days.

> I have a patch with me, let me post it shortly.

Please feel free to share your patches.=C2=A0 I've been looking into th= is
as well, but I'd be happy to see independent takes on it.

I reviewed your patch, it looks good. I ran the test= s you added and a few additional tests and they are passing. Please continu= e with your patch.
Maybe a test like "WHERE NEW.b > thres= hold" to confirm the expansion happens before qual evaluation would be= good.
=C2=A0
Thanks,
Satya
--0000000000006ca68c064f537890--