pgsql: Fix virtual generated column type checking for ALTER TABLE

From: Peter Eisentraut <peter(at)eisentraut(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Fix virtual generated column type checking for ALTER TABLE
Date: 2025-06-24 09:40:48
Message-ID: E1uU091-0036sx-2v@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Fix virtual generated column type checking for ALTER TABLE

Virtual generated columns have some special checks in
CheckAttributeType(), mainly to check that domains are not used. But
this check was only applied during CREATE TABLE, not during ALTER
TABLE. This fixes that.

Reported-by: jian he <jian(dot)universality(at)gmail(dot)com>
Discussion: https://www.postgresql.org/message-id/CACJufxE0KHR__-h=zHXbhSNZXMMs4LYo4-dbj8H3YoStYBok1Q@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/49fe1c83ecf3474776ea9d0db47ae5644d29b67b

Modified Files
--------------
src/backend/commands/tablecmds.c | 4 ++--
src/test/regress/expected/generated_virtual.out | 6 ++++++
src/test/regress/sql/generated_virtual.sql | 5 +++++
3 files changed, 13 insertions(+), 2 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Daniel Gustafsson 2025-06-24 09:59:49 pgsql: doc: Remove dead link to NewbieDoc Docbook Guide
Previous Message Tomas Vondra 2025-06-24 09:20:15 Re: pgsql: Introduce pg_shmem_allocations_numa view