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

Richard Guo <guofenglinux@gmail.com>

From: Richard Guo <guofenglinux@gmail.com>
To: Dean Rasheed <dean.a.rasheed@gmail.com>
Cc: Chao Li <li.evan.chao@gmail.com>, SATYANARAYANA NARLAPURAM <satyanarlapuram@gmail.com>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>, Peter Eisentraut <peter@eisentraut.org>
Date: 2026-04-21T06:05:07Z
Lists: pgsql-hackers
On Mon, Apr 20, 2026 at 5:42 PM Dean Rasheed <dean.a.rasheed@gmail.com> wrote:
> On Mon, 20 Apr 2026 at 08:29, Richard Guo <guofenglinux@gmail.com> wrote:
> > Attached v3 fixes them.

> LGTM.

Thanks!  I've pushed and back-patched to v14 (all supported branches).

Virtual generated columns and some helper functions such as
build_generation_expression were added in v18, so the back-patches in
pre-v18 branches differ slightly from the v18+ patches.

- Richard



Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. Fix incorrect NEW references to generated columns in rule rewriting