From: Tom Lane <tgl@sss.pgh.pa.us>
To: exclusion@gmail.com
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #17351: Altering a composite type created for a partitioned table can lead to a crash
Date: Sat, 01 Jan 2022 16:27:05 -0500
Message-ID: <3057471.1641072425@sss.pgh.pa.us> (raw)
In-Reply-To: <17351-6db1870f3f4f612a@postgresql.org>
References: <17351-6db1870f3f4f612a@postgresql.org>
PG Bug reporting form <noreply@postgresql.org> writes:
> When executing the following queries:
> create table pt (a int, b int) partition by list (b);
> create table t(a pt, check (a = '(1, 2)'::pt));
> alter table pt alter column a type char(4);
> \d+ t
> The server crashes with the following stack:
Hmm. We really ought to reject the ALTER TABLE. We do if "pt"
is a plain table:
regression=# create table pt (a int, b int);
CREATE TABLE
regression=# create table t(a pt);
CREATE TABLE
regression=# alter table pt alter column a type char(4);
ERROR: cannot alter table "pt" because column "t.a" uses its row type
So something is mistakenly skipping that check for partitioned
tables.
I think we're also failing to worry about the rowtype of the
constant in t's check constraint; it seems like that has to
be complained of as well, even if the underyling columns
aren't of type "pt".
regards, tom lane
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: pgsql-bugs@postgresql.org
Cc: tgl@sss.pgh.pa.us, exclusion@gmail.com, pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #17351: Altering a composite type created for a partitioned table can lead to a crash
In-Reply-To: <3057471.1641072425@sss.pgh.pa.us>
* 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