public inbox for [email protected]  
help / color / mirror / Atom feed
pgsql: In pg_dumpall, don't skip role GRANTs with dangling grantor OIDs
4+ messages / 1 participants
[nested] [flat]

* pgsql: In pg_dumpall, don't skip role GRANTs with dangling grantor OIDs
@ 2026-03-02 16:15 Tom Lane <[email protected]>
  0 siblings, 0 replies; 4+ messages in thread

From: Tom Lane @ 2026-03-02 16:15 UTC (permalink / raw)
  To: [email protected]

In pg_dumpall, don't skip role GRANTs with dangling grantor OIDs.

In commits 29d75b25b et al, I made pg_dumpall's dumpRoleMembership
logic treat a dangling grantor OID the same as dangling role and
member OIDs: print a warning and skip emitting the GRANT.  This wasn't
terribly well thought out; instead, we should handle the case by
emitting the GRANT without the GRANTED BY clause.  When the source
database is pre-v16, such cases are somewhat expected because those
versions didn't prevent dropping the grantor role; so don't even
print a warning that we did this.  (This change therefore restores
pg_dumpall's pre-v16 behavior for these cases.)  The case is not
expected in >= v16, so then we do print a warning, but soldiering on
with no GRANTED BY clause still seems like a reasonable strategy.

Per complaint from Robert Haas that we were now dropping GRANTs
altogether in easily-reachable scenarios.

Reported-by: Robert Haas <[email protected]>
Author: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/CA+TgmoauoiW4ydDhdrseg+DD4Kwha=+TSZp18BrJeHKx3o1Fdw@mail.gmail.com
Backpatch-through: 16

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/74b4438a70b9a2ea654501ce061ae7dea1e6a2ea

Modified Files
--------------
src/bin/pg_dump/pg_dumpall.c | 49 +++++++++++++++++++++++++++-----------------
1 file changed, 30 insertions(+), 19 deletions(-)



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

* pgsql: In pg_dumpall, don't skip role GRANTs with dangling grantor OIDs
@ 2026-03-02 16:15 Tom Lane <[email protected]>
  0 siblings, 0 replies; 4+ messages in thread

From: Tom Lane @ 2026-03-02 16:15 UTC (permalink / raw)
  To: [email protected]

In pg_dumpall, don't skip role GRANTs with dangling grantor OIDs.

In commits 29d75b25b et al, I made pg_dumpall's dumpRoleMembership
logic treat a dangling grantor OID the same as dangling role and
member OIDs: print a warning and skip emitting the GRANT.  This wasn't
terribly well thought out; instead, we should handle the case by
emitting the GRANT without the GRANTED BY clause.  When the source
database is pre-v16, such cases are somewhat expected because those
versions didn't prevent dropping the grantor role; so don't even
print a warning that we did this.  (This change therefore restores
pg_dumpall's pre-v16 behavior for these cases.)  The case is not
expected in >= v16, so then we do print a warning, but soldiering on
with no GRANTED BY clause still seems like a reasonable strategy.

Per complaint from Robert Haas that we were now dropping GRANTs
altogether in easily-reachable scenarios.

Reported-by: Robert Haas <[email protected]>
Author: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/CA+TgmoauoiW4ydDhdrseg+DD4Kwha=+TSZp18BrJeHKx3o1Fdw@mail.gmail.com
Backpatch-through: 16

Branch
------
REL_18_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/b09158cc776c48e551113e1a579c1c982d968c2f

Modified Files
--------------
src/bin/pg_dump/pg_dumpall.c | 49 +++++++++++++++++++++++++++-----------------
1 file changed, 30 insertions(+), 19 deletions(-)



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

* pgsql: In pg_dumpall, don't skip role GRANTs with dangling grantor OIDs
@ 2026-03-02 16:15 Tom Lane <[email protected]>
  0 siblings, 0 replies; 4+ messages in thread

From: Tom Lane @ 2026-03-02 16:15 UTC (permalink / raw)
  To: [email protected]

In pg_dumpall, don't skip role GRANTs with dangling grantor OIDs.

In commits 29d75b25b et al, I made pg_dumpall's dumpRoleMembership
logic treat a dangling grantor OID the same as dangling role and
member OIDs: print a warning and skip emitting the GRANT.  This wasn't
terribly well thought out; instead, we should handle the case by
emitting the GRANT without the GRANTED BY clause.  When the source
database is pre-v16, such cases are somewhat expected because those
versions didn't prevent dropping the grantor role; so don't even
print a warning that we did this.  (This change therefore restores
pg_dumpall's pre-v16 behavior for these cases.)  The case is not
expected in >= v16, so then we do print a warning, but soldiering on
with no GRANTED BY clause still seems like a reasonable strategy.

Per complaint from Robert Haas that we were now dropping GRANTs
altogether in easily-reachable scenarios.

Reported-by: Robert Haas <[email protected]>
Author: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/CA+TgmoauoiW4ydDhdrseg+DD4Kwha=+TSZp18BrJeHKx3o1Fdw@mail.gmail.com
Backpatch-through: 16

Branch
------
REL_17_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/1cd783d205443fec47c57a8ac28ac54ba8981e6f

Modified Files
--------------
src/bin/pg_dump/pg_dumpall.c | 49 +++++++++++++++++++++++++++-----------------
1 file changed, 30 insertions(+), 19 deletions(-)



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

* pgsql: In pg_dumpall, don't skip role GRANTs with dangling grantor OIDs
@ 2026-03-02 16:15 Tom Lane <[email protected]>
  0 siblings, 0 replies; 4+ messages in thread

From: Tom Lane @ 2026-03-02 16:15 UTC (permalink / raw)
  To: [email protected]

In pg_dumpall, don't skip role GRANTs with dangling grantor OIDs.

In commits 29d75b25b et al, I made pg_dumpall's dumpRoleMembership
logic treat a dangling grantor OID the same as dangling role and
member OIDs: print a warning and skip emitting the GRANT.  This wasn't
terribly well thought out; instead, we should handle the case by
emitting the GRANT without the GRANTED BY clause.  When the source
database is pre-v16, such cases are somewhat expected because those
versions didn't prevent dropping the grantor role; so don't even
print a warning that we did this.  (This change therefore restores
pg_dumpall's pre-v16 behavior for these cases.)  The case is not
expected in >= v16, so then we do print a warning, but soldiering on
with no GRANTED BY clause still seems like a reasonable strategy.

Per complaint from Robert Haas that we were now dropping GRANTs
altogether in easily-reachable scenarios.

Reported-by: Robert Haas <[email protected]>
Author: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/CA+TgmoauoiW4ydDhdrseg+DD4Kwha=+TSZp18BrJeHKx3o1Fdw@mail.gmail.com
Backpatch-through: 16

Branch
------
REL_16_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/a4649c50a8db58c19fa9a4f2ae12bef52b6c872b

Modified Files
--------------
src/bin/pg_dump/pg_dumpall.c | 49 +++++++++++++++++++++++++++-----------------
1 file changed, 30 insertions(+), 19 deletions(-)



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


end of thread, other threads:[~2026-03-02 16:15 UTC | newest]

Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2026-03-02 16:15 pgsql: In pg_dumpall, don't skip role GRANTs with dangling grantor OIDs Tom Lane <[email protected]>
2026-03-02 16:15 pgsql: In pg_dumpall, don't skip role GRANTs with dangling grantor OIDs Tom Lane <[email protected]>
2026-03-02 16:15 pgsql: In pg_dumpall, don't skip role GRANTs with dangling grantor OIDs Tom Lane <[email protected]>
2026-03-02 16:15 pgsql: In pg_dumpall, don't skip role GRANTs with dangling grantor OIDs Tom Lane <[email protected]>

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