Skip to content

Commit 55179b0

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 32e6331 commit 55179b0

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
@@ -1325,17 +1325,17 @@ dumpCreateDB(PGconn *conn)
13251325
appendStringLiteralConn(buf, dbname, conn);
13261326
appendPQExpBuffer(buf, ";\n");
13271327
}
1328+
}
13281329

1329-
if (binary_upgrade)
1330-
{
1331-
appendPQExpBuffer(buf, "-- For binary upgrade, set datfrozenxid.\n");
1332-
appendPQExpBuffer(buf, "UPDATE pg_catalog.pg_database "
1333-
"SET datfrozenxid = '%u' "
1334-
"WHERE datname = ",
1335-
dbfrozenxid);
1336-
appendStringLiteralConn(buf, dbname, conn);
1337-
appendPQExpBuffer(buf, ";\n");
1338-
}
1330+
if (binary_upgrade)
1331+
{
1332+
appendPQExpBuffer(buf, "-- For binary upgrade, set datfrozenxid.\n");
1333+
appendPQExpBuffer(buf, "UPDATE pg_catalog.pg_database "
1334+
"SET datfrozenxid = '%u' "
1335+
"WHERE datname = ",
1336+
dbfrozenxid);
1337+
appendStringLiteralConn(buf, dbname, conn);
1338+
appendPQExpBuffer(buf, ";\n");
13391339
}
13401340

13411341
if (!skip_acls &&

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy