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

From: Zsolt Parragi <zsolt(dot)parragi(at)percona(dot)com>
To: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: [PATCH] Rebuild CHECK constraints after generated column SET EXPRESSION
Date: 2026-05-13 14:57:29
Message-ID: CAN4CZFP+zuiGeBCiiv7H7Oo2MbEdCsTjKUpQ5NOGDo0Rw95NgQ@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
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?

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrei Lepikhov 2026-05-13 15:11:18 Re: Subquery pull-up increases jointree search space
Previous Message Pavlo Golub 2026-05-13 14:38:20 [PATCH v4] pg_stat_statements: Add last_execution_start column