diff options
author | Bruce Momjian <bruce@momjian.us> | 2015-02-11 21:02:07 -0500 |
---|---|---|
committer | Bruce Momjian <bruce@momjian.us> | 2015-02-11 21:02:28 -0500 |
commit | e20523f8f7649f0cb971ef0e8f8d97af9aa55b54 (patch) | |
tree | b33bf2debc9e8458b4df21686ae81eb4acba9e13 | |
parent | 734bbf2e978314cad86e1dd8fefe7f0c3f52a4ef (diff) | |
download | postgresql-e20523f8f7649f0cb971ef0e8f8d97af9aa55b54.tar.gz postgresql-e20523f8f7649f0cb971ef0e8f8d97af9aa55b54.zip |
pg_upgrade: preserve freeze info for postgres/template1 dbs
pg_database.datfrozenxid and pg_database.datminmxid were not preserved
for the 'postgres' and 'template1' databases. This could cause missing
clog file errors on access to user tables and indexes after upgrades in
these databases.
Backpatch through 9.0
-rw-r--r-- | src/bin/pg_dump/pg_dumpall.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/bin/pg_dump/pg_dumpall.c b/src/bin/pg_dump/pg_dumpall.c index c12cb0af2d1..e988958e1b7 100644 --- a/src/bin/pg_dump/pg_dumpall.c +++ b/src/bin/pg_dump/pg_dumpall.c @@ -1382,17 +1382,17 @@ dumpCreateDB(PGconn *conn) appendStringLiteralConn(buf, dbname, conn); appendPQExpBuffer(buf, ";\n"); } + } - if (binary_upgrade) - { - appendPQExpBuffer(buf, "-- For binary upgrade, set datfrozenxid and datminmxid.\n"); - appendPQExpBuffer(buf, "UPDATE pg_catalog.pg_database " - "SET datfrozenxid = '%u', datminmxid = '%u' " - "WHERE datname = ", - dbfrozenxid, dbminmxid); - appendStringLiteralConn(buf, dbname, conn); - appendPQExpBuffer(buf, ";\n"); - } + if (binary_upgrade) + { + appendPQExpBuffer(buf, "-- For binary upgrade, set datfrozenxid and datminmxid.\n"); + appendPQExpBuffer(buf, "UPDATE pg_catalog.pg_database " + "SET datfrozenxid = '%u', datminmxid = '%u' " + "WHERE datname = ", + dbfrozenxid, dbminmxid); + appendStringLiteralConn(buf, dbname, conn); + appendPQExpBuffer(buf, ";\n"); } if (!skip_acls && |