mirror of
https://github.com/postgres/postgres.git
synced 2026-04-22 06:37:06 -04:00
Fix pg_dumpall to restore its ability to dump from ancient servers.
Fix breakage induced by commitsd8d3d2a4f3and463f2625a5: 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 commit463f2625amade it fail always. In HEAD, also fix additional breakage induced in the same query by commit491c029dbc, which evidently wasn't tested against pre-8.1 servers either. The bug is only latent in 9.1 because463f2625ahadn't landed yet, but it seems best to back-patch all branches containing the faulty query. Gilles Darold
This commit is contained in:
parent
7eab804c22
commit
3c5ce5102e
1 changed files with 2 additions and 2 deletions
|
|
@ -679,7 +679,7 @@ dumpRoles(PGconn *conn)
|
|||
"ORDER BY 2");
|
||||
else
|
||||
printfPQExpBuffer(buf,
|
||||
"SELECT 0, usename as rolname, "
|
||||
"SELECT 0 as oid, usename as rolname, "
|
||||
"usesuper as rolsuper, "
|
||||
"true as rolinherit, "
|
||||
"usesuper as rolcreaterole, "
|
||||
|
|
@ -692,7 +692,7 @@ dumpRoles(PGconn *conn)
|
|||
"null as rolcomment "
|
||||
"FROM pg_shadow "
|
||||
"UNION ALL "
|
||||
"SELECT 0, groname as rolname, "
|
||||
"SELECT 0 as oid, groname as rolname, "
|
||||
"false as rolsuper, "
|
||||
"true as rolinherit, "
|
||||
"false as rolcreaterole, "
|
||||
|
|
|
|||
Loading…
Reference in a new issue