Skip to content

Commit e20523f

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 734bbf2 commit e20523f

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
@@ -1382,17 +1382,17 @@ dumpCreateDB(PGconn *conn)
13821382
appendStringLiteralConn(buf, dbname, conn);
13831383
appendPQExpBuffer(buf, ";\n");
13841384
}
1385+
}
13851386

1386-
if (binary_upgrade)
1387-
{
1388-
appendPQExpBuffer(buf, "-- For binary upgrade, set datfrozenxid and datminmxid.\n");
1389-
appendPQExpBuffer(buf, "UPDATE pg_catalog.pg_database "
1390-
"SET datfrozenxid = '%u', datminmxid = '%u' "
1391-
"WHERE datname = ",
1392-
dbfrozenxid, dbminmxid);
1393-
appendStringLiteralConn(buf, dbname, conn);
1394-
appendPQExpBuffer(buf, ";\n");
1395-
}
1387+
if (binary_upgrade)
1388+
{
1389+
appendPQExpBuffer(buf, "-- For binary upgrade, set datfrozenxid and datminmxid.\n");
1390+
appendPQExpBuffer(buf, "UPDATE pg_catalog.pg_database "
1391+
"SET datfrozenxid = '%u', datminmxid = '%u' "
1392+
"WHERE datname = ",
1393+
dbfrozenxid, dbminmxid);
1394+
appendStringLiteralConn(buf, dbname, conn);
1395+
appendPQExpBuffer(buf, ";\n");
13961396
}
13971397

13981398
if (!skip_acls &&

0 commit comments

Comments
 (0)