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

From David G. Johnston
Subject Re: Add SPLIT PARTITION/MERGE PARTITIONS commands
Date
Msg-id CAKFQuwao0EgGe9C5cPwr1e=9nkabiJRCyMAwNo5hjKebjZFoeg@mail.gmail.com
Whole thread Raw
In response to Re: Add SPLIT PARTITION/MERGE PARTITIONS commands  (Alexander Lakhin <exclusion@gmail.com>)
List pgsql-hackers
On Sunday, April 28, 2024, Alexander Lakhin <exclusion@gmail.com> wrote:

When we deal with mixed ownership, say, bob is an owner of a
partitioned table, but not an owner of a partition, should we
allow him to perform merge with that partition?


Attaching via alter table requires the user to own both the partitioned table and the table being acted upon.  Merge needs to behave similarly.

The fact that we let the superuser break the requirement of common ownership is unfortunate but I guess understandable.  But given the existing behavior of attach merge should likewise fail if it find the user doesn’t own the partitions being merged.  The fact that the user can select from those tables can be acted upon manually if desired; these administrative commands should all ensure common ownership and fail if that precondition is not met.

David J.

pgsql-hackers by date:

Previous
From: "David G. Johnston"
Date:
Subject: Re: Add SPLIT PARTITION/MERGE PARTITIONS commands
Next
From: Justin Pryzby
Date:
Subject: Re: Add SPLIT PARTITION/MERGE PARTITIONS commands