Commit 866f3017 authored by Bruce Momjian's avatar Bruce Momjian

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
parent 8785e6e3
...@@ -1416,17 +1416,17 @@ dumpCreateDB(PGconn *conn) ...@@ -1416,17 +1416,17 @@ dumpCreateDB(PGconn *conn)
dbconnlimit); dbconnlimit);
appendPQExpBufferStr(buf, ";\n"); appendPQExpBufferStr(buf, ";\n");
}
if (binary_upgrade) if (binary_upgrade)
{ {
appendPQExpBufferStr(buf, "-- For binary upgrade, set datfrozenxid and datminmxid.\n"); appendPQExpBufferStr(buf, "-- For binary upgrade, set datfrozenxid and datminmxid.\n");
appendPQExpBuffer(buf, "UPDATE pg_catalog.pg_database " appendPQExpBuffer(buf, "UPDATE pg_catalog.pg_database "
"SET datfrozenxid = '%u', datminmxid = '%u' " "SET datfrozenxid = '%u', datminmxid = '%u' "
"WHERE datname = ", "WHERE datname = ",
dbfrozenxid, dbminmxid); dbfrozenxid, dbminmxid);
appendStringLiteralConn(buf, dbname, conn); appendStringLiteralConn(buf, dbname, conn);
appendPQExpBufferStr(buf, ";\n"); appendPQExpBufferStr(buf, ";\n");
}
} }
if (!skip_acls && if (!skip_acls &&
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment