Re: [PATCH] Rebuild CHECK constraints after generated column SET EXPRESSION

From: jian he <jian(dot)universality(at)gmail(dot)com>
To: Ayush Tiwari <ayushtiwari(dot)slg01(at)gmail(dot)com>
Cc: Zsolt Parragi <zsolt(dot)parragi(at)percona(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [PATCH] Rebuild CHECK constraints after generated column SET EXPRESSION
Date: 2026-05-16 06:07:52
Message-ID: CACJufxGdr-A7hwBRWh02YHbb13M-LG3bAOad+86iivp2008tTA@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, May 15, 2026 at 12:00 PM Ayush Tiwari
<ayushtiwari(dot)slg01(at)gmail(dot)com> wrote:
>
> One question about the policy part: do we need to disallow SET
> EXPRESSION for whole-row policy references at all?
>
> For ordinary column references, RememberAllDependentForRebuilding()
> already sees PolicyRelationId, but it only errors for
> AT_AlterColumnType, not AT_SetExpression.

For AT_SetExpression:
RememberAllDependentForRebuilding does not handle policy objects.
We can safely ignore policy objects that contain whole-row variable
references too.

> Two small cleanup nits if the policy path stays:
>
> 1. `attnum` and `colName` are no longer referenced in
> RememberWholeRowDependentForRebuilding(), so they can be dropped
> from the signature.
>
In case we later need to cope with an ALTER TABLE command, such as
ALTER TABLE DROP COLUMN
and ALTER COLUMN SET DATA TYPE.
The signature also aligns with RememberAllDependentForRebuilding.

--
jian
https://www.enterprisedb.com/

Attachment Content-Type Size
v5-0001-recreate-wholerow-dependent-while-ALTER-COLUMN-SET-EXPRESSION.patch text/x-patch 13.4 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Mohamed ALi 2026-05-16 06:48:58 [PATCH] Add NESTED_STATEMENTS option to EXPLAIN
Previous Message jian he 2026-05-16 05:17:24 Re: Fix bug of COPY (on_error set_null)