Re: Add SPLIT PARTITION/MERGE PARTITIONS commands

Dmitry Koval <d.koval@postgrespro.ru>

From: Dmitry Koval <d.koval@postgrespro.ru>
To: jian he <jian.universality@gmail.com>
Cc: pgsql-hackers@lists.postgresql.org
Date: 2025-06-16T20:15:41Z
Lists: pgsql-hackers

Attachments

Hi!

1.
 >function name checkPartition is not ideal, maybe we can change it to
 >CheckPartitionForMerge or MergePartitionCheck.

I agree that this name is not ideal. But the "checkPartition" function
is used for both MERGE/SPLIT commands, so the word 'Merge' in the
prefix or suffix of the function name would not be correct ...
May be "checkPartitionForModification" or something like that?


 >The attached patch refactors transformPartitionCmdForMerge and
 >ATExecMergePartitions based on the idea of acquiring
 >AccessExclusiveLock on the to be merged partitions during
 >transformPartitionCmdForMerge

Thanks, applied.


2.
 >we need to expand the virtual generated column here,
 >otherwise, bms_is_member would  be not correct.
 >...
 >attach minor diff fix this problem.

Added patch and a bit modified test.

-- 
With best regards,
Dmitry Koval

Postgres Professional: http://postgrespro.com