@@ -761,39 +761,42 @@ dumpRoles(PGconn *conn)
761
761
i_is_current_user ;
762
762
int i ;
763
763
764
- /* note: rolconfig is dumped later */
764
+ /*
765
+ * Notes: rolconfig is dumped later, and pg_authid must be used for
766
+ * extracting rolcomment regardless of role_catalog.
767
+ */
765
768
if (server_version >= 90600 )
766
769
printfPQExpBuffer (buf ,
767
770
"SELECT oid, rolname, rolsuper, rolinherit, "
768
771
"rolcreaterole, rolcreatedb, "
769
772
"rolcanlogin, rolconnlimit, rolpassword, "
770
773
"rolvaliduntil, rolreplication, rolbypassrls, "
771
- "pg_catalog.shobj_description(oid, '%s ') as rolcomment, "
774
+ "pg_catalog.shobj_description(oid, 'pg_authid ') as rolcomment, "
772
775
"rolname = current_user AS is_current_user "
773
776
"FROM %s "
774
777
"WHERE rolname !~ '^pg_' "
775
- "ORDER BY 2" , role_catalog , role_catalog );
778
+ "ORDER BY 2" , role_catalog );
776
779
else if (server_version >= 90500 )
777
780
printfPQExpBuffer (buf ,
778
781
"SELECT oid, rolname, rolsuper, rolinherit, "
779
782
"rolcreaterole, rolcreatedb, "
780
783
"rolcanlogin, rolconnlimit, rolpassword, "
781
784
"rolvaliduntil, rolreplication, rolbypassrls, "
782
- "pg_catalog.shobj_description(oid, '%s ') as rolcomment, "
785
+ "pg_catalog.shobj_description(oid, 'pg_authid ') as rolcomment, "
783
786
"rolname = current_user AS is_current_user "
784
787
"FROM %s "
785
- "ORDER BY 2" , role_catalog , role_catalog );
788
+ "ORDER BY 2" , role_catalog );
786
789
else
787
790
printfPQExpBuffer (buf ,
788
791
"SELECT oid, rolname, rolsuper, rolinherit, "
789
792
"rolcreaterole, rolcreatedb, "
790
793
"rolcanlogin, rolconnlimit, rolpassword, "
791
794
"rolvaliduntil, rolreplication, "
792
795
"false as rolbypassrls, "
793
- "pg_catalog.shobj_description(oid, '%s ') as rolcomment, "
796
+ "pg_catalog.shobj_description(oid, 'pg_authid ') as rolcomment, "
794
797
"rolname = current_user AS is_current_user "
795
798
"FROM %s "
796
- "ORDER BY 2" , role_catalog , role_catalog );
799
+ "ORDER BY 2" , role_catalog );
797
800
798
801
res = executeQuery (conn , buf -> data );
799
802
0 commit comments