mirror of
https://github.com/postgres/postgres.git
synced 2025-07-28 23:42:10 +03:00
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.
This commit is contained in:
@ -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)
|
||||
|
Reference in New Issue
Block a user