Re: Bug: Rule actions see wrong values for generated columns (NEW.gen reads OLD value)

From: SATYANARAYANA NARLAPURAM <satyanarlapuram(at)gmail(dot)com>
To: Richard Guo <guofenglinux(at)gmail(dot)com>
Cc: Chao Li <li(dot)evan(dot)chao(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Peter Eisentraut <peter(at)eisentraut(dot)org>
Subject: Re: Bug: Rule actions see wrong values for generated columns (NEW.gen reads OLD value)
Date: 2026-04-13 08:42:49
Message-ID: CAHg+QDda7fkd_z6ZXuhRVtVyRf2J=BCP9nRrHqL2_0=HWQnzSA@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi Richard,

On Mon, Apr 13, 2026 at 1:30 AM Richard Guo <guofenglinux(at)gmail(dot)com> wrote:

> On Mon, Apr 13, 2026 at 4:27 PM SATYANARAYANA NARLAPURAM
> <satyanarlapuram(at)gmail(dot)com> wrote:
> > On Mon, Apr 13, 2026 at 12:21 AM Chao Li <li(dot)evan(dot)chao(at)gmail(dot)com> 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 of
> 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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message cca5507 2026-04-13 08:47:38 Return value of XLogInsertRecord() for XLOG_SWITCH record
Previous Message Heikki Linnakangas 2026-04-13 08:34:44 Re: Heads Up: cirrus-ci is shutting down June 1st