diff options
Diffstat (limited to 'src/bin/pg_dump/pg_dumpall.c')
-rw-r--r-- | src/bin/pg_dump/pg_dumpall.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/src/bin/pg_dump/pg_dumpall.c b/src/bin/pg_dump/pg_dumpall.c index 2cad796..591fcb0 100644 --- a/src/bin/pg_dump/pg_dumpall.c +++ b/src/bin/pg_dump/pg_dumpall.c @@ -761,28 +761,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 printfPQExpBuffer(buf, "SELECT oid, rolname, rolsuper, rolinherit, " @@ -790,10 +793,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); res = executeQuery(conn, buf->data); |