public inbox for [email protected]  
help / color / mirror / Atom feed
From: Peter Eisentraut <[email protected]>
To: [email protected]
Subject: pgsql: Whole-row fixes for ALTER COLUMN SET EXPRESSION
Date: Wed, 08 Jul 2026 17:58:34 +0000
Message-ID: <[email protected]> (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 <[email protected]>
Co-authored-by: Peter Eisentraut <[email protected]>
Reported-by: Ayush Tiwari <[email protected]>
Reviewed-by: Ayush Tiwari <[email protected]>
Reviewed-by: solai v <[email protected]>
Reviewed-by: Zsolt Parragi <[email protected]>
Discussion: https://www.postgresql.org/message-id/flat/CAJTYsWXOkyeDVbzymWc9sKrq7Y_MUv6XJXN4H9GfsBOPd3NJ+w@mail....

Branch
------
REL_19_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/9530898940302d6f501fb54a3fbc61cbfb7768bf

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)

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: [email protected]
  Cc: [email protected], [email protected]
  Subject: Re: pgsql: Whole-row fixes for ALTER COLUMN SET EXPRESSION
  In-Reply-To: <[email protected]>

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

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