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

From: Richard Guo <guofenglinux(at)gmail(dot)com>
To: SATYANARAYANA NARLAPURAM <satyanarlapuram(at)gmail(dot)com>
Cc: 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 02:35:52
Message-ID: CAMbWs4-SJ6B26ciFu_K_2M1ObDA=GirV87N1BKeAtSRmQGATUA@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Apr 13, 2026 at 10:59 AM SATYANARAYANA NARLAPURAM
<satyanarlapuram(at)gmail(dot)com> wrote:
> NEW.<generated_coulmn> is resolved to the OLD row's value
> for update or NULL for insert cases in a DO ALSO rule action for
> generated columns. This bug affects both stored and virtual
> generated columns. Reporting here to see if this is a known issue
> with generated columns.

I didn't find related item in open items. This does not seem to be a
known issue. I think we should fix it anyway.

cc-ing Peter.

- Richard

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message David Rowley 2026-04-13 02:43:01 Re: Small and unlikely overflow hazard in bms_next_member()
Previous Message Andres Freund 2026-04-13 02:20:43 Re: test_compression, test module for low-level compression APIs (for 2b5ba2a0a141)