On Fri, Aug 21, 2026 at 10:17 PM Alexander Korotkov
<[email protected]> wrote:
>
> +1, that was the way forward I was going to propose.  I'm going to
> post the patch later today.
>

We currently don't have a mechanism to recreate triggers. Therefore, for now, we
should error out when ALTER TABLE MERGE PARTITIONS is performed on partitioned
tables or partitions that have triggers.

We should also error out in the following cases:

* A partition has CHECK or NOT NULL constraints where conislocal = true.
* A partition has a local index that is not part of the partition
index hierarchy.
* The partition column's default differs from the partitioned table's
column default.
* The partition table's access method differs from that of the
partitioned table.

I think we can allow STATISTICS and COMMENTS because these objects
were not cascaded to child tables when created.
Should we also error out when the column compression method differs,
or when the column's pg_type.typstorage differs?

What do you think?

The attached patch (based on v6) is very rough; I will polish it later.

Attachment: disallow_more_cases_merge_partition.nocfbot
Description: Binary data

Reply via email to