Skip to content

Commit d99cf27

Browse files
committed
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
1 parent 0168fb0 commit d99cf27

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

src/bin/pg_dump/pg_dumpall.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1356,17 +1356,17 @@ dumpCreateDB(PGconn *conn)
13561356
appendStringLiteralConn(buf, dbname, conn);
13571357
appendPQExpBuffer(buf, ";\n");
13581358
}
1359+
}
13591360

1360-
if (binary_upgrade)
1361-
{
1362-
appendPQExpBuffer(buf, "-- For binary upgrade, set datfrozenxid.\n");
1363-
appendPQExpBuffer(buf, "UPDATE pg_catalog.pg_database "
1364-
"SET datfrozenxid = '%u' "
1365-
"WHERE datname = ",
1366-
dbfrozenxid);
1367-
appendStringLiteralConn(buf, dbname, conn);
1368-
appendPQExpBuffer(buf, ";\n");
1369-
}
1361+
if (binary_upgrade)
1362+
{
1363+
appendPQExpBuffer(buf, "-- For binary upgrade, set datfrozenxid.\n");
1364+
appendPQExpBuffer(buf, "UPDATE pg_catalog.pg_database "
1365+
"SET datfrozenxid = '%u' "
1366+
"WHERE datname = ",
1367+
dbfrozenxid);
1368+
appendStringLiteralConn(buf, dbname, conn);
1369+
appendPQExpBuffer(buf, ";\n");
13701370
}
13711371

13721372
if (!skip_acls &&

0 commit comments

Comments
 (0)