From c7bc5be11de9ed9e4b9ee6c06e65fee314bab7e0 Mon Sep 17 00:00:00 2001 From: Bruce Momjian Date: Wed, 11 Feb 2015 21:02:07 -0500 Subject: [PATCH] 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 --- src/bin/pg_dump/pg_dumpall.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/bin/pg_dump/pg_dumpall.c b/src/bin/pg_dump/pg_dumpall.c index 0f1de59fd0c..19467a4fecc 100644 --- a/src/bin/pg_dump/pg_dumpall.c +++ b/src/bin/pg_dump/pg_dumpall.c @@ -1398,17 +1398,17 @@ dumpCreateDB(PGconn *conn) appendStringLiteralConn(buf, dbname, conn); appendPQExpBufferStr(buf, ";\n"); } + } - if (binary_upgrade) - { - appendPQExpBufferStr(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); - appendPQExpBufferStr(buf, ";\n"); - } + if (binary_upgrade) + { + appendPQExpBufferStr(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); + appendPQExpBufferStr(buf, ";\n"); } if (!skip_acls && -- 2.39.5