Re: Add SPLIT PARTITION/MERGE PARTITIONS commands

From: jian he <jian(dot)universality(at)gmail(dot)com>
To: Dmitry Koval <d(dot)koval(at)postgrespro(dot)ru>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Add SPLIT PARTITION/MERGE PARTITIONS commands
Date: 2025-05-22 02:59:10
Message-ID: CACJufxGqtakuKce+k-WNc9hqzaXA86SaKb3_v2qE_fT_1SdDZA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, May 22, 2025 at 1:01 AM Dmitry Koval <d(dot)koval(at)postgrespro(dot)ru> wrote:
>
> > for example:
> > ...
>
> If in both examples you replace
>
> create role bob;
>
> with
>
> create role bob SUPERUSER;
>
> and in the second example add "set role bob;" before "alter table ..."
> query, then no error will be occur.
>

That is fine.
superuser can bypass all permission checks.
superuser can attach any table to the partitioned table as he wants.

for example:

begin;
create role alice SUPERUSER;
create role bob SUPERUSER;
GRANT all privileges on schema public to alice;
GRANT all privileges on schema public to bob;
set role bob;
create table at_partitioned (a int, b text) partition by range (a);
set role alice;
create table at_part_2 (b text, a int);
set role bob;
alter table at_partitioned attach partition at_part_2 for values from
(1000) to (2000);
rollback;

Am I missing something?

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Zhijie Hou (Fujitsu) 2025-05-22 03:00:21 RE: Conflict detection for update_deleted in logical replication
Previous Message Zhijie Hou (Fujitsu) 2025-05-22 02:59:02 RE: Conflict detection for update_deleted in logical replication