mirror of
https://git.postgresql.org/git/postgresql.git
synced 2025-02-17 19:30:00 +08:00
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
This commit is contained in:
parent
734bbf2e97
commit
e20523f8f7
@ -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 &&
|
||||
|
Loading…
Reference in New Issue
Block a user