Prevent altering partitioned table's rowtype, if it's used elsewhere. We disallow altering a column datatype within a regular table, if the table's rowtype is used as a column type elsewhere, because we lack code to go around and rewrite the other tables. This restriction should apply to partitioned tables as well, but it was not checked because ATRewriteTables and ATPrepAlterColumnType were not on the same page about who should do it for which relkinds.
Per bug #17351 from Alexander Lakhin. Back-patch to all supported branches. Discussion: https://postgr.es/m/[email protected] Branch ------ REL_11_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/2ce113a4f085e078286a921d4cbe63b0dc34794e Modified Files -------------- src/backend/commands/tablecmds.c | 8 +++++--- src/test/regress/expected/alter_table.out | 23 ++++++++++++++++++----- src/test/regress/sql/alter_table.sql | 19 +++++++++++++++---- 3 files changed, 38 insertions(+), 12 deletions(-)
