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