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_muv6xjxn4h9gfsbopd3n...@mail.gmail.com

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(+)

Reply via email to