Re: [PATCH] Rebuild CHECK constraints after generated column SET EXPRESSION
solai v <solai.cdac@gmail.com>
From: solai v <solai.cdac@gmail.com>
To: jian he <jian.universality@gmail.com>
Cc: Ayush Tiwari <ayushtiwari.slg01@gmail.com>,
Zsolt Parragi <zsolt.parragi@percona.com>, PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Date: 2026-05-19T05:31:27Z
Lists: pgsql-hackers
Hi I tested v5-0001-recreate-wholerow-dependent-while-ALTER-COLUMN-SET-EXPRESSION.patch on the current master.The patch applied cleanly and PostgreSQL built successfully. I was able to reproduce the issue on unpatched master using a whole-row CHECK constraint referencing the generated column through:CHECK ((gtest).b IS NOT NULL). Without the patch,ALTER COLUMN SET EXPRESSION succeeded even though existing rows no longer satisfied the constraint. After applying the patch ,the same ALTER TABLE command correctly failed with : ERROR:check constraint "whole_row_check" of relation "gtest" is violated by some row. The fix and regression coverage look good to me. Regards, Solai