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