aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBruce Momjian <bruce@momjian.us>2015-02-11 21:02:07 -0500
committerBruce Momjian <bruce@momjian.us>2015-02-11 21:02:44 -0500
commit866f3017a88b9cb639f05c9ad413e5eafe0266e3 (patch)
tree5412c0fbe20f80692904abf8a2f9981d06c630b5 /src
parent8785e6e378f919827d851926ea0f400f08afd477 (diff)
downloadpostgresql-866f3017a88b9cb639f05c9ad413e5eafe0266e3.tar.gz
postgresql-866f3017a88b9cb639f05c9ad413e5eafe0266e3.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
Diffstat (limited to 'src')
-rw-r--r--src/bin/pg_dump/pg_dumpall.c20
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 3e3b4335a21..6a7a6415f6e 100644
--- a/src/bin/pg_dump/pg_dumpall.c
+++ b/src/bin/pg_dump/pg_dumpall.c
@@ -1416,17 +1416,17 @@ dumpCreateDB(PGconn *conn)
dbconnlimit);
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 &&