Skip to content

Commit 0845538

Browse files
committed
dumpUserConfig failed (in a pretty harmless way, but failed nonetheless)
to cope with a group name when dumping from a pre-8.1 installation. Per report from Stefan Kaltenbrunner.
1 parent 974e3cf commit 0845538

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/bin/pg_dump/pg_dumpall.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* Portions Copyright (c) 1994, Regents of the University of California
77
*
88
*
9-
* $PostgreSQL: pgsql/src/bin/pg_dump/pg_dumpall.c,v 1.66 2005/07/31 17:19:19 tgl Exp $
9+
* $PostgreSQL: pgsql/src/bin/pg_dump/pg_dumpall.c,v 1.67 2005/08/28 16:31:37 tgl Exp $
1010
*
1111
*-------------------------------------------------------------------------
1212
*/
@@ -928,10 +928,10 @@ dumpUserConfig(PGconn *conn, const char *username)
928928
else
929929
printfPQExpBuffer(buf, "SELECT useconfig[%d] FROM pg_shadow WHERE usename = ", count);
930930
appendStringLiteral(buf, username, true);
931-
appendPQExpBuffer(buf, ";");
932931

933932
res = executeQuery(conn, buf->data);
934-
if (!PQgetisnull(res, 0, 0))
933+
if (PQntuples(res) == 1 &&
934+
!PQgetisnull(res, 0, 0))
935935
{
936936
makeAlterConfigCommand(PQgetvalue(res, 0, 0), "ROLE", username);
937937
PQclear(res);

0 commit comments

Comments
 (0)