pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Prevent altering partitioned table's rowtype, if it's used elsew
Date: Thu, 06 Jan 2022 21:47:13 +0000
Message-ID: <E1n5abJ-0004Ns-WB@gemulon.postgresql.org> (raw)

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_13_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/86d4bbb56a8aa94e8926067a5bf86a5a74b8c933

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, 36 insertions(+), 13 deletions(-)



view thread (6+ messages)  latest in thread

Message-ID: <E1n5abJ-0004Ns-WB@gemulon.postgresql.org>
Permalink:  ../E1n5abJ-0004Ns-WB@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1n5abJ-0004Ns-WB@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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: tgl@sss.pgh.pa.us
  Subject: Re: pgsql: Prevent altering partitioned table's rowtype, if it's used elsew
  In-Reply-To: <E1n5abJ-0004Ns-WB@gemulon.postgresql.org>
  References: <E1n5abJ-0004Ns-WB@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