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 CAPpHfduH83+CW1dBppFVjxauPFGC+-ux+Y7wB0koZJCs029SXA@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
Hi, Dmitry!

On Tue, May 20, 2025 at 1:36 AM Dmitry Koval <d.koval@postgrespro.ru> wrote:
> Changes in patches:
>
> 1) Added usage of SECURITY_RESTRICTED_OPERATION for SPLIT/MERGE
> PARTITION(S) commands.
>
> 2) For SPLIT PARTITION command: new partitions will have the same owner
> as the parent.
>
> 3) For MERGE PARTITIONS command: if merged partitions have different
> owners, an error will be generated.

Some notes to the patch.
1) I think we need explicitly document who is the owner of the new
partition(s).  The documentation for MERGE command says all the merged
partitions should have the same owner.  Good, but also we need to
state that the new partition should have the same owner.  Same to the
SPLIT command.
2) I think we also need to describe what happens not just with
ownership, but with ACLs.  We currently don't do anything to them, so
basically we discard existing ACLs.  It's probably OK, and we could
introduce options for ACL handling later.  But we need to state in the
docs that it's user responsibility to setup ACL on new partition(s).

------
Regards,
Alexander Korotkov
Supabase



pgsql-hackers by date:

Previous
From: Yugo Nagata
Date:
Subject: Re: Improve tab completion for COPY
Next
From: Dilip Kumar
Date:
Subject: Re: [PATCH] Allow parallelism for plpgsql return expression after commit 556f7b7