pgsql: Prevent altering partitioned table's rowtype, if it's used elsew - Mailing list pgsql-committers

From Tom Lane
Subject pgsql: Prevent altering partitioned table's rowtype, if it's used elsew
Date
Msg-id E1n5abK-0004Ny-15@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
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/17351-6db1870f3f4f612a@postgresql.org

Branch
------
REL_10_STABLE

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

Modified Files
--------------
src/backend/commands/tablecmds.c          |  7 ++++---
src/test/regress/expected/alter_table.out | 23 ++++++++++++++++++-----
src/test/regress/sql/alter_table.sql      | 19 +++++++++++++++----
3 files changed, 37 insertions(+), 12 deletions(-)


pgsql-committers by date:

Previous
From: Tom Lane
Date:
Subject: pgsql: Prevent altering partitioned table's rowtype, if it's used elsew
Next
From: Michael Paquier
Date:
Subject: pgsql: Refactor tar method of walmethods.c to rely on the compression m