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

From jian he
Subject Re: Add SPLIT PARTITION/MERGE PARTITIONS commands
Date
Msg-id CACJufxF1Hfx1PST7pCLrKkGcjHEn2A51znXmYwVccnt5GDORcw@mail.gmail.com
Whole thread Raw
In response to Re: Add SPLIT PARTITION/MERGE PARTITIONS commands  (Dmitry Koval <d.koval@postgrespro.ru>)
Responses Re: Add SPLIT PARTITION/MERGE PARTITIONS commands
List pgsql-hackers
On Tue, Sep 16, 2025 at 6:11 AM Dmitry Koval <d.koval@postgrespro.ru> wrote:
>
> 7) Additionally, I've made a numerous and small fixes for grammar to the
> docs directly to the patchset.
>

v56-0002, SPLIT PARTITION check_partitions_for_split is way too overwhelming.
Similar to transformPartitionCmdForMerge, we can put some error handling code
to transformPartitionCmdForSplit.
please check the attached refactoring.

in v56-0001
+ Oid newPartitionOid = InvalidOid;
+
+ foreach_oid(mergingPartitionOid, mergingPartitions)
+ {
+ if (mergingPartitionOid == existingRelid)
+ {
+ newPartitionOid = mergingPartitionOid;
+ break;
+ }
+ }

can simplified to
        if (list_member_oid(mergingPartitions, existingRelid))
            newPartitionOid = existingRelid;

Attachment

pgsql-hackers by date:

Previous
From: Peter Smith
Date:
Subject: Re: Add support for specifying tables in pg_createsubscriber.
Next
From: Peter Eisentraut
Date:
Subject: Re: Cannot find a working 64-bit integer type on Illumos