Skip to content

Commit 3c5ce51

Browse files
committed
Fix pg_dumpall to restore its ability to dump from ancient servers.
Fix breakage induced by commits d8d3d2a and 463f262: pg_dumpall has crashed when attempting to dump from pre-8.1 servers since then, due to faulty construction of the query used for dumping roles from older servers. The query was erroneous as of the earlier commit, but it wasn't exposed unless you tried to use --binary-upgrade, which you presumably wouldn't with a pre-8.1 server. However commit 463f262 made it fail always. In HEAD, also fix additional breakage induced in the same query by commit 491c029, which evidently wasn't tested against pre-8.1 servers either. The bug is only latent in 9.1 because 463f262 hadn't landed yet, but it seems best to back-patch all branches containing the faulty query. Gilles Darold
1 parent 7eab804 commit 3c5ce51

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/bin/pg_dump/pg_dumpall.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -679,7 +679,7 @@ dumpRoles(PGconn *conn)
679679
"ORDER BY 2");
680680
else
681681
printfPQExpBuffer(buf,
682-
"SELECT 0, usename as rolname, "
682+
"SELECT 0 as oid, usename as rolname, "
683683
"usesuper as rolsuper, "
684684
"true as rolinherit, "
685685
"usesuper as rolcreaterole, "
@@ -692,7 +692,7 @@ dumpRoles(PGconn *conn)
692692
"null as rolcomment "
693693
"FROM pg_shadow "
694694
"UNION ALL "
695-
"SELECT 0, groname as rolname, "
695+
"SELECT 0 as oid, groname as rolname, "
696696
"false as rolsuper, "
697697
"true as rolinherit, "
698698
"false as rolcreaterole, "

0 commit comments

Comments
 (0)