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

Zsolt Parragi <zsolt.parragi@percona.com>

From: Zsolt Parragi <zsolt.parragi@percona.com>
To: pgsql-hackers@lists.postgresql.org
Date: 2026-05-13T14:57:29Z
Lists: pgsql-hackers
Hello!

+ALTER TABLE gtest20c ALTER COLUMN b SET EXPRESSION AS (NULL::int);
-- violates constraint
+ERROR:  check constraint "whole_row_check" of relation "gtest20c" is
violated by some row
+-- indedx with whole-row reference need rebuild
+CREATE TABLE gtest20d (a int, b int GENERATED ALWAYS AS (a * 2) STORED);
+INSERT INTO gtest20d VALUES (1), (1);

This is in generated_virtual.sql, is that STORED a copy-paste mistake?