Re: Add SPLIT PARTITION/MERGE PARTITIONS commands - Mailing list pgsql-hackers

From Alexander Korotkov
Subject Re: Add SPLIT PARTITION/MERGE PARTITIONS commands
Date
Msg-id CAPpHfdsao-VXZYN8-vRm543EFUE7=4tq+hcTh5iEc6ikqWq_cQ@mail.gmail.com
Whole thread
In response to Re: Add SPLIT PARTITION/MERGE PARTITIONS commands  (Dmitry Koval <d.koval@postgrespro.ru>)
List pgsql-hackers
On Fri, Jun 26, 2026 at 6:20 PM Dmitry Koval <d.koval@postgrespro.ru> wrote:
> If we exclude case with DEFAULT partition, MERGE PARTITIONS command was
> intended to be used when an incorrect table partitioning was chosen.
> For example, a table was initially partitioned by month, but later we
> needed to change table partitioning by quarter. In this case, MERGE
> PARTITIONS command should merge several adjacent partitions into one.
> Current checks are made for this case.
>
>  >- If there's *no* default partition, then I think the check should be
>  >relaxed; it's sufficient to verify that the bounds of the merged
>  >partition do not overlap with any partition which is not being merged;
>
> It's probably possible to do this. But in this case, the command will
> not exactly be "MERGE PARTITIONS" ("MERGE PARTITIONS & EXPAND"?).

+1,
We can implement a support for this for 20.  For 19, I propose to
state the restriction more explicit in the docs.  See the attached
patch.

------
Regards,
Alexander Korotkov
Supabase

Attachment

pgsql-hackers by date:

Previous
From: Ian Lawrence Barwick
Date:
Subject: Re: DOCS - "Get Object DDL Functions" table improvements
Next
From: Robert Haas
Date:
Subject: Re: Why clearing the VM doesn't require registering vm buffer in wal record