Alexander Lakhin <exclusion@gmail.com> writes:
> 27.03.2023 21:20, Tom Lane wrote:
>> 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);
Sure, but there you already have a partition. If you only had "tbl"
then there would be no stored partition bounds.
regards, tom lane