Skip to content

Commit c778e27

Browse files
committed
Correct query in pg_dumpall:dumpRoles
We need to use a new branch due to the 9.5 addition of bypassrls when adding in the clause to exclude pg_* roles from being dumped by pg_dumpall. Pointed out by Noah, patch by me.
1 parent eccfeeb commit c778e27

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/bin/pg_dump/pg_dumpall.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -676,6 +676,16 @@ dumpRoles(PGconn *conn)
676676
"FROM pg_authid "
677677
"WHERE rolname !~ '^pg_' "
678678
"ORDER BY 2");
679+
else if (server_version >= 90500)
680+
printfPQExpBuffer(buf,
681+
"SELECT oid, rolname, rolsuper, rolinherit, "
682+
"rolcreaterole, rolcreatedb, "
683+
"rolcanlogin, rolconnlimit, rolpassword, "
684+
"rolvaliduntil, rolreplication, rolbypassrls, "
685+
"pg_catalog.shobj_description(oid, 'pg_authid') as rolcomment, "
686+
"rolname = current_user AS is_current_user "
687+
"FROM pg_authid "
688+
"ORDER BY 2");
679689
else if (server_version >= 90100)
680690
printfPQExpBuffer(buf,
681691
"SELECT oid, rolname, rolsuper, rolinherit, "

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy