pg.ddx.io  pgpartman/pg_partman GitHub issues and pull requests  
help / color / mirror / Atom feed
[pgpartman/pg_partman] issue #858: Clarify ownership requirement for create_parent() (parent table vs partition set)
11+ messages / 2 participants
[nested] [flat]

* [pgpartman/pg_partman] issue #858: Clarify ownership requirement for create_parent() (parent table vs partition set)
@ 2026-04-07 09:05 "paula-corral (@paula-corral)" <noreply+paula-corral@github.com>
  0 siblings, 0 replies; 11+ messages in thread

From: paula-corral (@paula-corral) @ 2026-04-07 09:05 UTC (permalink / raw)
  To: pgpartman/pg_partman <noreply+pgpartman-pg_partman@github.com>

Hi,

While setting up pg_partman (v5.4.1) in PostgreSQL (v14.22), I ran into an issue that seems related to role requirements when creating a dedicated user for pg_partman.

In the documentation, it mentions:
> “If not using a superuser, it is recommended that a dedicated role is created for running pg_partman functions and to be the owner of all partition sets that pg_partman maintains.”

and then lists the required grants. However, it’s not entirely clear whether this explicitly requires ownership of the *parent table* itself, or if privileges are enough.

Here is a reproducible example:

```sql
-- as role paula (superuser)
CREATE TABLE paula.test1 (
    id bigserial,
    created_at timestamptz NOT NULL DEFAULT now(),
    concept text,
    PRIMARY KEY (created_at, id)
) PARTITION BY RANGE (created_at);

CREATE TABLE partman.test_template1 (LIKE paula.test1);

CREATE ROLE partman_user;

GRANT ALL ON SCHEMA partman TO partman_user;
GRANT ALL ON ALL TABLES IN SCHEMA partman TO partman_user;
GRANT EXECUTE ON ALL FUNCTIONS IN SCHEMA partman TO partman_user;
GRANT EXECUTE ON ALL PROCEDURES IN SCHEMA partman TO partman_user;

GRANT ALL ON SCHEMA paula TO partman_user;
GRANT ALL ON ALL TABLES IN SCHEMA paula TO partman_user;
GRANT TEMPORARY ON DATABASE paula TO partman_user;

-- switch role
SET ROLE partman_user;

SELECT partman.create_parent(
    p_parent_table := 'paula.test1',
    p_control := 'created_at',
    p_interval := '10 minutes',
    p_premake := 12,
    p_default_table := false,
    p_automatic_maintenance := 'off',
    p_jobmon := false,
    p_template_table := 'partman.test_template1'
);
```

It throws the error:
```sql
ERROR: must be owner of table test1 
CONTEXT: ALTER TABLE paula.test1 ATTACH PARTITION ...
```

From this behavior, it seems that the role executing `create_parent()` must own the parent table (paula.test1), not just have privileges on it. Could you confirm if the intended requirement is that the role must own the parent table, and not just have privileges on the schema/tables? If so, it might help to clarify this in the documentation, since “owner of partition sets” can be interpreted as referring mainly to partitions rather than the parent table.

Thanks!

^ permalink  raw  [nested|flat] 11+ messages in thread

* Re: [pgpartman/pg_partman] issue #858: Clarify ownership requirement for create_parent() (parent table vs partition set)
@ 2026-04-07 13:46 ` "keithf4 (@keithf4)" <noreply+keithf4@github.com>
  9 siblings, 0 replies; 11+ messages in thread

From: keithf4 (@keithf4) @ 2026-04-07 13:46 UTC (permalink / raw)
  To: pgpartman/pg_partman <noreply+pgpartman-pg_partman@github.com>

Yes, the role running the partition maintenance should be the owner of the table, or be in a group that owns the table. You can then grant usage privileges to others that need to just use the table normally.

I'll try and see if that can be clarified. Thank you!

^ permalink  raw  [nested|flat] 11+ messages in thread

* Re: [pgpartman/pg_partman] issue #858: Clarify ownership requirement for create_parent() (parent table vs partition set)
@ 2026-04-07 13:46 ` "keithf4 (@keithf4)" <noreply+keithf4@github.com>
  9 siblings, 0 replies; 11+ messages in thread

From: keithf4 (@keithf4) @ 2026-04-07 13:46 UTC (permalink / raw)
  To: pgpartman/pg_partman <noreply+pgpartman-pg_partman@github.com>

@keithf4 assigned @keithf4.

^ permalink  raw  [nested|flat] 11+ messages in thread

* Re: [pgpartman/pg_partman] issue #858: Clarify ownership requirement for create_parent() (parent table vs partition set)
@ 2026-04-07 13:46 ` "keithf4 (@keithf4)" <noreply+keithf4@github.com>
  9 siblings, 0 replies; 11+ messages in thread

From: keithf4 (@keithf4) @ 2026-04-07 13:46 UTC (permalink / raw)
  To: pgpartman/pg_partman <noreply+pgpartman-pg_partman@github.com>

@keithf4 applied label "documentation".

^ permalink  raw  [nested|flat] 11+ messages in thread

* Re: [pgpartman/pg_partman] issue #858: Clarify ownership requirement for create_parent() (parent table vs partition set)
@ 2026-04-07 13:46 ` "keithf4 (@keithf4)" <noreply+keithf4@github.com>
  9 siblings, 0 replies; 11+ messages in thread

From: keithf4 (@keithf4) @ 2026-04-07 13:46 UTC (permalink / raw)
  To: pgpartman/pg_partman <noreply+pgpartman-pg_partman@github.com>

@keithf4 set milestone to "Next Patch".

^ permalink  raw  [nested|flat] 11+ messages in thread

* Re: [pgpartman/pg_partman] issue #858: Clarify ownership requirement for create_parent() (parent table vs partition set)
@ 2026-10-28 14:01 ` "keithf4 (@keithf4)" <noreply+keithf4@github.com>
  9 siblings, 0 replies; 11+ messages in thread

From: keithf4 (@keithf4) @ 2026-10-28 14:01 UTC (permalink / raw)
  To: pgpartman/pg_partman <noreply+pgpartman-pg_partman@github.com>

@keithf4 applied label "fixed in next release".

^ permalink  raw  [nested|flat] 11+ messages in thread

* Re: [pgpartman/pg_partman] issue #858: Clarify ownership requirement for create_parent() (parent table vs partition set)
@ 2026-10-28 14:27 ` "keithf4 (@keithf4)" <noreply+keithf4@github.com>
  9 siblings, 0 replies; 11+ messages in thread

From: keithf4 (@keithf4) @ 2026-10-28 14:27 UTC (permalink / raw)
  To: pgpartman/pg_partman <noreply+pgpartman-pg_partman@github.com>

I've updated the documetation with clarity for this in the `551` branch if you'd like to review it. Will hopefully have this released next week. Thank you!

^ permalink  raw  [nested|flat] 11+ messages in thread

* Re: [pgpartman/pg_partman] issue #858: Clarify ownership requirement for create_parent() (parent table vs partition set)
@ 2026-11-19 10:20 ` "keithf4 (@keithf4)" <noreply+keithf4@github.com>
  9 siblings, 0 replies; 11+ messages in thread

From: keithf4 (@keithf4) @ 2026-11-19 10:20 UTC (permalink / raw)
  To: pgpartman/pg_partman <noreply+pgpartman-pg_partman@github.com>

@keithf4 removed milestone.

^ permalink  raw  [nested|flat] 11+ messages in thread

* Re: [pgpartman/pg_partman] issue #858: Clarify ownership requirement for create_parent() (parent table vs partition set)
@ 2026-11-19 10:20 ` "keithf4 (@keithf4)" <noreply+keithf4@github.com>
  9 siblings, 0 replies; 11+ messages in thread

From: keithf4 (@keithf4) @ 2026-11-19 10:20 UTC (permalink / raw)
  To: pgpartman/pg_partman <noreply+pgpartman-pg_partman@github.com>

@keithf4 set milestone to "5.5".

^ permalink  raw  [nested|flat] 11+ messages in thread

* Re: [pgpartman/pg_partman] issue #858: Clarify ownership requirement for create_parent() (parent table vs partition set)
@ 2026-11-19 10:21 ` "keithf4 (@keithf4)" <noreply+keithf4@github.com>
  9 siblings, 0 replies; 11+ messages in thread

From: keithf4 (@keithf4) @ 2026-11-19 10:21 UTC (permalink / raw)
  To: pgpartman/pg_partman <noreply+pgpartman-pg_partman@github.com>

@keithf4 applied label "fixed in current release".

^ permalink  raw  [nested|flat] 11+ messages in thread

* Re: [pgpartman/pg_partman] issue #858: Clarify ownership requirement for create_parent() (parent table vs partition set)
@ 2026-11-19 10:21 ` "keithf4 (@keithf4)" <noreply+keithf4@github.com>
  9 siblings, 0 replies; 11+ messages in thread

From: keithf4 (@keithf4) @ 2026-11-19 10:21 UTC (permalink / raw)
  To: pgpartman/pg_partman <noreply+pgpartman-pg_partman@github.com>

@keithf4 removed label "fixed in next release".

^ permalink  raw  [nested|flat] 11+ messages in thread


end of thread, other threads:[~2026-11-19 10:21 UTC | newest]

Thread overview: 11+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2026-04-07 09:05 [pgpartman/pg_partman] issue #858: Clarify ownership requirement for create_parent() (parent table vs partition set) "paula-corral (@paula-corral)" <noreply+paula-corral@github.com>
2026-04-07 13:46 ` "keithf4 (@keithf4)" <noreply+keithf4@github.com>
2026-04-07 13:46 ` "keithf4 (@keithf4)" <noreply+keithf4@github.com>
2026-04-07 13:46 ` "keithf4 (@keithf4)" <noreply+keithf4@github.com>
2026-04-07 13:46 ` "keithf4 (@keithf4)" <noreply+keithf4@github.com>
2026-10-28 14:01 ` "keithf4 (@keithf4)" <noreply+keithf4@github.com>
2026-10-28 14:27 ` "keithf4 (@keithf4)" <noreply+keithf4@github.com>
2026-11-19 10:20 ` "keithf4 (@keithf4)" <noreply+keithf4@github.com>
2026-11-19 10:20 ` "keithf4 (@keithf4)" <noreply+keithf4@github.com>
2026-11-19 10:21 ` "keithf4 (@keithf4)" <noreply+keithf4@github.com>
2026-11-19 10:21 ` "keithf4 (@keithf4)" <noreply+keithf4@github.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox