summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/bin/pg_dump/pg_dumpall.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/src/bin/pg_dump/pg_dumpall.c b/src/bin/pg_dump/pg_dumpall.c
index 434e6e85041..23d42060cdd 100644
--- a/src/bin/pg_dump/pg_dumpall.c
+++ b/src/bin/pg_dump/pg_dumpall.c
@@ -760,28 +760,31 @@ dumpRoles(PGconn *conn)
i_is_current_user;
int i;
- /* note: rolconfig is dumped later */
+ /*
+ * Notes: rolconfig is dumped later, and pg_authid must be used for
+ * extracting rolcomment regardless of role_catalog.
+ */
if (server_version >= 90600)
printfPQExpBuffer(buf,
"SELECT oid, rolname, rolsuper, rolinherit, "
"rolcreaterole, rolcreatedb, "
"rolcanlogin, rolconnlimit, rolpassword, "
"rolvaliduntil, rolreplication, rolbypassrls, "
- "pg_catalog.shobj_description(oid, '%s') as rolcomment, "
+ "pg_catalog.shobj_description(oid, 'pg_authid') as rolcomment, "
"rolname = current_user AS is_current_user "
"FROM %s "
"WHERE rolname !~ '^pg_' "
- "ORDER BY 2", role_catalog, role_catalog);
+ "ORDER BY 2", role_catalog);
else if (server_version >= 90500)
printfPQExpBuffer(buf,
"SELECT oid, rolname, rolsuper, rolinherit, "
"rolcreaterole, rolcreatedb, "
"rolcanlogin, rolconnlimit, rolpassword, "
"rolvaliduntil, rolreplication, rolbypassrls, "
- "pg_catalog.shobj_description(oid, '%s') as rolcomment, "
+ "pg_catalog.shobj_description(oid, 'pg_authid') as rolcomment, "
"rolname = current_user AS is_current_user "
"FROM %s "
- "ORDER BY 2", role_catalog, role_catalog);
+ "ORDER BY 2", role_catalog);
else if (server_version >= 90100)
printfPQExpBuffer(buf,
"SELECT oid, rolname, rolsuper, rolinherit, "
@@ -789,10 +792,10 @@ dumpRoles(PGconn *conn)
"rolcanlogin, rolconnlimit, rolpassword, "
"rolvaliduntil, rolreplication, "
"false as rolbypassrls, "
- "pg_catalog.shobj_description(oid, '%s') as rolcomment, "
+ "pg_catalog.shobj_description(oid, pg_authid') as rolcomment, "
"rolname = current_user AS is_current_user "
"FROM %s "
- "ORDER BY 2", role_catalog, role_catalog);
+ "ORDER BY 2", role_catalog);
else if (server_version >= 80200)
printfPQExpBuffer(buf,
"SELECT oid, rolname, rolsuper, rolinherit, "
@@ -800,10 +803,10 @@ dumpRoles(PGconn *conn)
"rolcanlogin, rolconnlimit, rolpassword, "
"rolvaliduntil, false as rolreplication, "
"false as rolbypassrls, "
- "pg_catalog.shobj_description(oid, '%s') as rolcomment, "
+ "pg_catalog.shobj_description(oid, 'pg_authid') as rolcomment, "
"rolname = current_user AS is_current_user "
"FROM %s "
- "ORDER BY 2", role_catalog, role_catalog);
+ "ORDER BY 2", role_catalog);
else if (server_version >= 80100)
printfPQExpBuffer(buf,
"SELECT oid, rolname, rolsuper, rolinherit, "