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

From Zhihong Yu
Subject Re: Add SPLIT PARTITION/MERGE PARTITIONS commands
Date
Msg-id CALNJ-vSuzLxR+tyCiLA4s8sznn_M8aXdSVSYx-Sxb5E9jUG+8A@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 Wed, Jul 13, 2022 at 11:28 AM Dmitry Koval <d.koval@postgrespro.ru> wrote:
Hi!

Patch stop applying due to changes in upstream.
Here is a rebased version.

--
With best regards,
Dmitry Koval

Postgres Professional: http://postgrespro.com
Hi,

+attachPartTable(List **wqueue, Relation rel, Relation partition, PartitionBoundSpec *bound) 

I checked naming of existing methods, such as AttachPartitionEnsureIndexes.
I think it would be better if the above method is named attachPartitionTable.

+   if (!defaultPartCtx && OidIsValid(defaultPartOid))
+   {
+       pc = createSplitPartitionContext(table_open(defaultPartOid, AccessExclusiveLock));

Since the value of pc would be passed to defaultPartCtx, there is no need to assign to pc above. You can assign directly to defaultPartCtx.

+   /* Drop splitted partition. */

splitted -> split

+   /* Rename new partition if it is need. */

need -> needed.

Cheers

pgsql-hackers by date:

Previous
From: Nathan Bossart
Date:
Subject: Re: allow building trusted languages without the untrusted versions
Next
From: Tom Lane
Date:
Subject: Re: make update-po@master stops at pg_upgrade