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

From: Ayush Tiwari <ayushtiwari(dot)slg01(at)gmail(dot)com>
To: jian he <jian(dot)universality(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 07:18:05
Message-ID: CAJTYsWUuBHWorsj2hSgW9Xsogv-7SAKY0cBi3HehF12==UidPg@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On Sat, 16 May 2026 at 11:38, jian he <jian(dot)universality(at)gmail(dot)com> wrote:

> 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.
>
>
Thanks, v5 addresses my concern about policies. Ignoring whole-row
policy references for SET EXPRESSION makes sense to me, and the comment
explains the distinction clearly.

No further comments from me.

Regards,
Ayush

In response to

Browse pgsql-hackers by date

  From Date Subject
Previous Message Xuneng Zhou 2026-05-16 07:13:03 Re: BUG: Cascading standby fails to reconnect after falling back to archive recovery