Re: BUG #17872: Dropping an attribute of a composite type breaks indexes over the type silently - Mailing list pgsql-bugs

From Alexander Lakhin
Subject Re: BUG #17872: Dropping an attribute of a composite type breaks indexes over the type silently
Date
Msg-id 67cb509e-93c7-1c7b-2388-d7e00277b344@gmail.com
Whole thread Raw
In response to Re: BUG #17872: Dropping an attribute of a composite type breaks indexes over the type silently  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: BUG #17872: Dropping an attribute of a composite type breaks indexes over the type silently
List pgsql-bugs
27.03.2023 21:20, Tom Lane wrote:
> Alexander Lakhin <exclusion@gmail.com> writes:
>> Yes, I think something like that can resolve the issue.
>> But I would also note that the problem is not with indexes only, but also
>> with "... partition by list(comp_type_value)", for example.
> Hmm ... really?  I'd just concluded that a partitioned table is okay
> as long as it doesn't yet have any partitions.  Even if the modified
> type is a partitioning column, there's no structure yet that could
> depend on the contents of the type.  (If it does have partitions,
> we'll fail when we get to one of those.)

The following query leads to a failure on showing a partition definition:
CREATE TABLE tbl(a int, b int) PARTITION BY LIST ((tbl));
CREATE TABLE tblp PARTITION OF tbl FOR VALUES IN ('(2,4)');
ALTER TABLE tbl ALTER COLUMN a TYPE char(5);
\d+ tbl
(The effect depends on the values specified.)
It's not exactly the dependency issue but still is related to altering
a composite type.

Best regards,
Alexander



pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: BUG #17872: Dropping an attribute of a composite type breaks indexes over the type silently
Next
From: Tom Lane
Date:
Subject: Re: BUG #17872: Dropping an attribute of a composite type breaks indexes over the type silently