Skip to content

Commit 79b2fa5

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 5f1d931 commit 79b2fa5

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
@@ -672,7 +672,7 @@ dumpRoles(PGconn *conn)
672672
"ORDER BY 2");
673673
else
674674
printfPQExpBuffer(buf,
675-
"SELECT 0, usename as rolname, "
675+
"SELECT 0 as oid, usename as rolname, "
676676
"usesuper as rolsuper, "
677677
"true as rolinherit, "
678678
"usesuper as rolcreaterole, "
@@ -685,7 +685,7 @@ dumpRoles(PGconn *conn)
685685
"null as rolcomment "
686686
"FROM pg_shadow "
687687
"UNION ALL "
688-
"SELECT 0, groname as rolname, "
688+
"SELECT 0 as oid, groname as rolname, "
689689
"false as rolsuper, "
690690
"true as rolinherit, "
691691
"false as rolcreaterole, "

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