Re: FOR PORTION OF does not recompute GENERATED STORED columns that depend on the range column

From: Paul A Jungwirth <pj(at)illuminatedcomputing(dot)com>
To: Chao Li <li(dot)evan(dot)chao(at)gmail(dot)com>
Cc: Peter Eisentraut <peter(at)eisentraut(dot)org>, jian he <jian(dot)universality(at)gmail(dot)com>, SATYANARAYANA NARLAPURAM <satyanarlapuram(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: FOR PORTION OF does not recompute GENERATED STORED columns that depend on the range column
Date: 2026-05-07 23:26:08
Message-ID: CA+renyW_rOD66MF1EAkGQ3B3GPzyRFuV0-eu53U38o0VMELjCA@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, May 6, 2026 at 10:55 PM Chao Li <li(dot)evan(dot)chao(at)gmail(dot)com> wrote:
>
> > I didn’t review this patch earlier because, from the subject, I thought it was only about recomputing generated stored columns. I just noticed that the patch also changes the inheritance-table path, and I posted another patch for the inheritance-table bug. Please see [1].
> >
> > I tried applying the new tests from my patch on top of this patch, and it looks like this patch still does not fix the multi-inheritance case.
> >
> > So I’d like to check with you how we should proceed. I think there are two options:
> >
> > 1. Keep this patch focused on the generated-column issue described in the subject, and use my patch to fix the inheritance-table bug.
> > 2. I can continue from this patch and extend it to fix the multi-inheritance case as well.
> >
> > Please let me know what you prefer.

Thanks for your help on this! I agree that separating the patches
would be better.

> I just looked into v9 and made a fix in ExecInitForPortionOf() that resolves the bug with multi-inheritance tables. I also added a test case for that.
>
> The inheritance-table bug affects not only UPDATE, but also DELETE, so I added test cases for DELETE as well. Please see 0002 for my changes.
>
> To make each commit self-contained, would you mind moving the code for the inheritance-table fix to 0002? Then you can keep focusing on 0001, and I can continue working on 0002.
>
> PFA v10 - 0001 the same as v9. 0002 fixed a bug with multi-inheritance tables.

I'll post a v11 addressing the feedback in your other email and moving
the fixes for partitions/inheritance.

Yours,

--
Paul ~{:-)
pj(at)illuminatedcomputing(dot)com

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Paul A Jungwirth 2026-05-07 23:47:46 Re: FOR PORTION OF does not recompute GENERATED STORED columns that depend on the range column
Previous Message Bruce Momjian 2026-05-07 23:08:21 Re: First draft of PG 19 release notes