| 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-15 02:52:07 |
| Message-ID: | CACJufxGBSeAcyStRHajNvqerGCRGB5Wb=e5cbGd7HFT4=aMsLw@mail.gmail.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
On Fri, May 15, 2026 at 1:06 AM Ayush Tiwari
<ayushtiwari(dot)slg01(at)gmail(dot)com> wrote:
>
> I've two minor follow-up comments/questions:
>
> 1. The "-- indedx with whole-row reference need rebuild" comment is
> still in the new SQL/expected blocks for both generated_stored and
> generated_virtual:
> "-- index with whole-row reference needs rebuild"
>
Thanks for finding the typo!
I did another round of code cleanup and cosmetic refactoring. Main
idea still the same: loop through
pg_constraint, pg_index, and pg_policy to locate all objects
containing whole-row
references, then error reporting or remember them for recreation.
The commit message was also updated.
Later, I will add this thread to
https://wiki.postgresql.org/wiki/PostgreSQL_19_Open_Items
> 2. The new policy error message:
>
> errmsg("ALTER TABLE / SET EXPRESSION is not supported for
> generated columns in tables that are part of a policy
> definition"),
> errdetail("%s contains whole row references.", ...)
>
> I still find this wording a bit awkward. Quoting "ALTER TABLE /
> SET EXPRESSION" as a syntactic form in the message is unusual for
> tablecmds.c, and the sentence is long. Could we keep it closer to
> the surrounding style.
>
+ if (subtype == AT_SetExpression)
+ ereport(ERROR,
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot alter generation
expression of table %s because %s uses its row type",
+ RelationGetRelationName(rel),
+ getObjectDescription(&pol_obj, false)),
+ errdetail("You might need to drop %s
first.", getObjectDescription(&pol_obj, false)));
What do you think?
| Attachment | Content-Type | Size |
|---|---|---|
| v4-0001-Disallow-or-rebuild-dependent-while-ALTER-COLUMN-SET-EXPRESSION.patch | application/x-patch | 25.3 KB |
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Chao Li | 2026-05-15 03:08:54 | Re: Should IGNORE NULLS cache nullness for volatile arguments? |
| Previous Message | Tom Lane | 2026-05-15 02:49:38 | Re: Re-add recently-removed tests for ltree and intarray |