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

From: Peter Eisentraut <peter(at)eisentraut(dot)org>
To: Paul A Jungwirth <pj(at)illuminatedcomputing(dot)com>, Chao Li <li(dot)evan(dot)chao(at)gmail(dot)com>
Cc: 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-06-04 09:58:48
Message-ID: 1397d468-9d00-40b3-9f92-da73d4ae50ad@eisentraut.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 26.05.26 00:23, Paul A Jungwirth wrote:
> On Fri, May 8, 2026 at 8:25 AM Paul A Jungwirth
> <pj(at)illuminatedcomputing(dot)com> wrote:
>>
>> On Fri, May 8, 2026 at 12:10 AM Chao Li <li(dot)evan(dot)chao(at)gmail(dot)com> wrote:
>>>> <v11-0001-Fix-FOR-PORTION-OF-column-dependency-tracking.patch><v11-0002-Fix-FOR-PORTION-OF-with-partitions-and-inheritan.patch>
>>>
>>> Thanks for updating the patch and making the separation. After reading v11, I still have a few comments for 0001.
>> . . .
>>
>> v12 attached.
>
> After discussing this as PGConf.dev, Peter and I agreed that we
> *should* be checking for UPDATE permission on the application-time
> column. So we need to add the attno to updatedCols on the
> RTEPermissionInfo. That is great, because it fixes GENERATED column
> dependency tracking and also UPDATE OF triggers, without the
> complexity of changing ExecGetUpdatedCols.
>
> Note we still do not require INSERT permission for the temporal
> leftovers, which is what the SQL Standard says and also makes sense
> semantically, since those leftovers represent already-existing
> history.
>
> No RLS changes are needed because RLS policies aren't checked based on
> *column* changes.
>
> We still need a fix for non-partitioning inheritance, but the patch
> becomes a lot simpler.
>
> Here is a patch adding the application-time column to updatedCols,
> along with the tests we've written for GENERATED columns and UPDATE OF
> triggers.

committed

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Anthonin Bonnefoy 2026-06-04 10:00:56 Re: [PATCH v4] pg_stat_statements: Add last_execution_start column
Previous Message Ashutosh Bapat 2026-06-04 09:55:05 Re: GRAPH_TABLE: lateral reference with label disjunction fails with "plan should not reference subplan's variable"