BUG #19962: pg_dumpall can't produce restorable circular grants with ADMIN OPTION

From: PG Bug reporting form <noreply(at)postgresql(dot)org>
To: pgsql-bugs(at)lists(dot)postgresql(dot)org
Cc: exclusion(at)gmail(dot)com
Subject: BUG #19962: pg_dumpall can't produce restorable circular grants with ADMIN OPTION
Date: 2026-12-01 07:00:01
Message-ID: 19962-530e0c11d39d12e3@postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

The following bug has been logged on the website:

Bug reference: 19962
Logged by: Alexander Lakhin
Email address: exclusion(at)gmail(dot)com
PostgreSQL version: 19.0
Operating system: Ubuntu 24.04
Description:

The following statements:
CREATE ROLE r1;
CREATE ROLE r2;
CREATE ROLE r3;

GRANT r1 TO r3 WITH ADMIN OPTION;
GRANT r1 TO r2 WITH ADMIN OPTION GRANTED BY r3;
GRANT r1 TO r2 WITH ADMIN OPTION GRANTED BY CURRENT_USER;
GRANT r1 TO r3 WITH ADMIN OPTION GRANTED BY r2;
REVOKE r1 FROM r2 GRANTED BY CURRENT_USER;

create a role membership configuration that can't be processed by
pg_dumpall/restore or pg_upgrade, namely:
pg_dumpall -f dump.sql

produces dump.sql that contains:
...
GRANT r1 TO r3 WITH ADMIN OPTION, INHERIT TRUE GRANTED BY law;
GRANT r1 TO r2 WITH ADMIN OPTION, INHERIT TRUE GRANTED BY r3;
GRANT r1 TO r3 WITH ADMIN OPTION, INHERIT TRUE GRANTED BY r2;

An attempt to restore this dump fails with:
ERROR: ADMIN option cannot be granted back to your own grantor

Reproduced starting from ce6b672e4.

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Laurenz Albe 2026-12-01 08:20:46 Re: SIMILAR TO expressions translate wildcards where they shouldn't
Previous Message Kirill Reshke 2026-12-01 05:38:33 Re: BUG #19846: dump/restore marks inherited NOT VALID not-null constraint as local