diff options
author | Bruce Momjian <bruce@momjian.us> | 2012-11-30 16:30:13 -0500 |
---|---|---|
committer | Bruce Momjian <bruce@momjian.us> | 2012-11-30 16:30:13 -0500 |
commit | 12ee6ec71f8754ff3573711032b9b4d5a764ba84 (patch) | |
tree | 08dccd260579d668a68efcf73463025f02472cfa /src | |
parent | bd9c8e741b5724e31b2a3d8da9f0218f7b3b44e5 (diff) |
In pg_upgrade, dump each database separately and use
--single-transaction to restore each database schema. This yields
performance improvements for databases with many tables. Also, remove
split_old_dump() as it is no longer needed.
Diffstat (limited to 'src')
-rw-r--r-- | src/bin/pg_dump/pg_dumpall.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/bin/pg_dump/pg_dumpall.c b/src/bin/pg_dump/pg_dumpall.c index 77dfbc282f7..aa4fcbb2b3c 100644 --- a/src/bin/pg_dump/pg_dumpall.c +++ b/src/bin/pg_dump/pg_dumpall.c @@ -502,7 +502,7 @@ main(int argc, char *argv[]) } /* Dump CREATE DATABASE commands */ - if (!globals_only && !roles_only && !tablespaces_only) + if (binary_upgrade || (!globals_only && !roles_only && !tablespaces_only)) dumpCreateDB(conn); /* Dump role/database settings */ @@ -745,9 +745,11 @@ dumpRoles(PGconn *conn) * will acquire the right properties even if it already exists (ie, it * won't hurt for the CREATE to fail). This is particularly important * for the role we are connected as, since even with --clean we will - * have failed to drop it. + * have failed to drop it. binary_upgrade cannot generate any errors, + * so we assume the role is already created. */ - appendPQExpBuffer(buf, "CREATE ROLE %s;\n", fmtId(rolename)); + if (!binary_upgrade) + appendPQExpBuffer(buf, "CREATE ROLE %s;\n", fmtId(rolename)); appendPQExpBuffer(buf, "ALTER ROLE %s WITH", fmtId(rolename)); if (strcmp(PQgetvalue(res, i, i_rolsuper), "t") == 0) |