diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2005-08-28 16:31:37 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2005-08-28 16:31:37 +0000 |
commit | 0845538f3aeeadbf32a04131222cb4bd447543f8 (patch) | |
tree | 5c633e056e4fd24d61aca353dfc01208ecd5da77 /src | |
parent | 974e3cf30afe783c26cfcdc0658833a682f6b357 (diff) | |
download | postgresql-0845538f3aeeadbf32a04131222cb4bd447543f8.tar.gz postgresql-0845538f3aeeadbf32a04131222cb4bd447543f8.zip |
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.
Diffstat (limited to 'src')
-rw-r--r-- | src/bin/pg_dump/pg_dumpall.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/bin/pg_dump/pg_dumpall.c b/src/bin/pg_dump/pg_dumpall.c index 28032c47b93..92ca0143b05 100644 --- a/src/bin/pg_dump/pg_dumpall.c +++ b/src/bin/pg_dump/pg_dumpall.c @@ -6,7 +6,7 @@ * Portions Copyright (c) 1994, Regents of the University of California * * - * $PostgreSQL: pgsql/src/bin/pg_dump/pg_dumpall.c,v 1.66 2005/07/31 17:19:19 tgl Exp $ + * $PostgreSQL: pgsql/src/bin/pg_dump/pg_dumpall.c,v 1.67 2005/08/28 16:31:37 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -928,10 +928,10 @@ dumpUserConfig(PGconn *conn, const char *username) else printfPQExpBuffer(buf, "SELECT useconfig[%d] FROM pg_shadow WHERE usename = ", count); appendStringLiteral(buf, username, true); - appendPQExpBuffer(buf, ";"); res = executeQuery(conn, buf->data); - if (!PQgetisnull(res, 0, 0)) + if (PQntuples(res) == 1 && + !PQgetisnull(res, 0, 0)) { makeAlterConfigCommand(PQgetvalue(res, 0, 0), "ROLE", username); PQclear(res); |