Re: MERGE/SPLIT PARTITIONS issues/questions

From: jian he <jian(dot)universality(at)gmail(dot)com>
To: Alexander Korotkov <aekorotkov(at)gmail(dot)com>
Cc: Melanie Plageman <melanieplageman(at)gmail(dot)com>, Zsolt Parragi <zsolt(dot)parragi(at)percona(dot)com>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: MERGE/SPLIT PARTITIONS issues/questions
Date: 2026-08-24 10:39:57
Message-ID: CACJufxGzR4vJZJNTULW2tfrx0jbpetB89M7nNirXLGOLfSQ3Lw@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-hackers

On Fri, Aug 21, 2026 at 10:17 PM Alexander Korotkov
<aekorotkov(at)gmail(dot)com> 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 Content-Type Size
disallow_more_cases_merge_partition.nocfbot application/octet-stream 20.3 KB

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Ewan Young 2026-08-24 11:20:42 Re: BUG #19595: Three memory-safety defects in src/backend/tsearch/spell.c (dictionary loader), PG 18.3
Previous Message zengman 2026-08-24 03:37:13 Re:BUG #19625: SQL/JSON boolean DEFAULT expression silently replaced with 'false'

Browse pgsql-hackers by date

  From Date Subject
Next Message Ashutosh Bapat 2026-08-24 10:43:48 Re: Fix GRAPH TABLE label and property error reporting
Previous Message Virender Singla 2026-08-24 10:38:10 Re: Allow pg_read_all_stats to read replication origin status