pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Peter Eisentraut <peter@eisentraut.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Whole-row fixes for ALTER COLUMN SET EXPRESSION
Date: Wed, 08 Jul 2026 17:58:34 +0000
Message-ID: <E1whWXa-000AxC-04@gemulon.postgresql.org> (raw)

Whole-row fixes for ALTER COLUMN SET EXPRESSION

When changing the expression of a generated column via ALTER TABLE
ALTER COLUMN SET EXPRESSION, objects that depend on the column via
indirect whole-row references (such as CHECK constraints, indexes)
must be handled specially, because technically pg_depend does not
contain such dependencies, see
recordDependencyOnSingleRelExpr->find_expr_references_walker.

This is a fix for commit f80bedd52, "Allow ALTER COLUMN SET EXPRESSION
on virtual columns with CHECK constraints".

Author: jian he <jian.universality@gmail.com>
Co-authored-by: Peter Eisentraut <peter@eisentraut.org>
Reported-by: Ayush Tiwari <ayushtiwari.slg01@gmail.com>
Reviewed-by: Ayush Tiwari <ayushtiwari.slg01@gmail.com>
Reviewed-by: solai v <solai.cdac@gmail.com>
Reviewed-by: Zsolt Parragi <zsolt.parragi@percona.com>
Discussion: https://www.postgresql.org/message-id/flat/CAJTYsWXOkyeDVbzymWc9sKrq7Y_MUv6XJXN4H9GfsBOPd3NJ+w@mail....

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/a4639d64e2199885f8e995395b6fe874cb7228bf

Modified Files
--------------
src/backend/commands/tablecmds.c                | 176 ++++++++++++++++++++++++
src/test/regress/expected/generated_stored.out  |   9 ++
src/test/regress/expected/generated_virtual.out |   9 ++
src/test/regress/sql/generated_stored.sql       |  10 ++
src/test/regress/sql/generated_virtual.sql      |  10 ++
5 files changed, 214 insertions(+)



view thread (2+ messages)  latest in thread

Message-ID: <E1whWXa-000AxC-04@gemulon.postgresql.org>
Permalink:  ../E1whWXa-000AxC-04@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1whWXa-000AxC-04@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: peter@eisentraut.org, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Whole-row fixes for ALTER COLUMN SET EXPRESSION
  In-Reply-To: <E1whWXa-000AxC-04@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox