Fix dumping role comments when using --no-role-passwords
authorDaniel Gustafsson <[email protected]>
Thu, 21 Mar 2024 22:31:57 +0000 (23:31 +0100)
committerDaniel Gustafsson <[email protected]>
Thu, 21 Mar 2024 22:31:57 +0000 (23:31 +0100)
commitbe01c8c3450e48fbe8baa13625e1d36e0814c29b
tree1c96586348a5d8aa4a47424c26bdd96e0c938376
parent33bfbef1d60fdccbfb72423b2e1e7c4074a640b9
Fix dumping role comments when using --no-role-passwords

Commit 9a83d56b38c added support for allowing pg_dumpall to dump
roles without including passwords, which accidentally made dumps
omit COMMENTs on roles.  This fixes it by using pg_authid to get
the comment.

Backpatch to all supported versions. Patch simultaneously written
independently by Álvaro and myself.

Author: Álvaro Herrera <[email protected]>
Author: Daniel Gustafsson <[email protected]>
Reported-by: Bartosz Chroł <[email protected]>
Discussion: https://postgr.es/m/AS8P194MB1271CDA0ADCA7B75FCD8E767F7332@AS8P194MB1271.EURP194.PROD.OUTLOOK.COM
Discussion: https://postgr.es/m/CAEP4nAz9V4H41_4ESJd1Gf0v%3DdevkqO1%3Dpo91jUw-GJSx8Hxqg%40mail.gmail.com
Backpatch-through: v12
src/bin/pg_dump/pg_dumpall.c