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

From: jian he <jian(dot)universality(at)gmail(dot)com>
To: Paul A Jungwirth <pj(at)illuminatedcomputing(dot)com>
Cc: 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-04-22 01:11:18
Message-ID: CACJufxHai+HB1gkNqVEHe4oKyUmXfAagWBYAWXYKy8hyMV3RxA@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Apr 21, 2026 at 11:00 PM Paul A Jungwirth
<pj(at)illuminatedcomputing(dot)com> wrote:
>
> On Mon, Apr 20, 2026 at 8:58 PM jian he <jian(dot)universality(at)gmail(dot)com> wrote:
> >
> > + updatedCols =
> > + bms_add_member(updatedCols,
> > + rangeAttno - FirstLowInvalidHeapAttributeNumber);
> >
> > Here, use "perminfo->updatedCols" not "updatedCols", otherwise segfault.
> > The attached diff based on v5, fixes this issue.
> >
> > +ALTER TABLE temporal_partitioned_3 ADD COLUMN range_len int GENERATED
> > ALWAYS AS (upper(valid_at) - lower(valid_at)) STORED;
> > Slightly refactoring the tests will allow for easier comparison of
> > range_len values.
>
> I can't reproduce a segfault. I don't see how that code would lead to
> one. Can you share what you're doing to cause it? Simply running the
> regression tests doesn't do it for me.
>

Sorry for the noise. After cleaning the cached build directory and
rebuilding, there is now no issue.

+#include "nodes/print.h"
This should be removed from v5.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Smith 2026-04-22 01:17:31 Re: Get rid of translation strings that only contain punctuation
Previous Message Tom Lane 2026-04-22 00:51:48 Re: Get rid of translation strings that only contain punctuation