1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-27 12:41:57 +03:00

pg_upgrade: preserve the timestamp epoch

This is useful for replication tools like Slony and Skytools.  This is a
backpatch of a74a4aa23b.

Report by Sergey Konoplev

Backpatch through 9.3
This commit is contained in:
Bruce Momjian
2014-09-11 18:39:46 -04:00
parent b8b4124011
commit 022aea346d
3 changed files with 18 additions and 9 deletions

View File

@ -233,16 +233,20 @@ get_control_data(ClusterInfo *cluster, bool live_check)
}
else if ((p = strstr(bufin, "Latest checkpoint's NextXID:")) != NULL)
{
char *op = strchr(p, '/');
p = strchr(p, ':');
if (op == NULL)
op = strchr(p, ':');
if (op == NULL || strlen(op) <= 1)
if (p == NULL || strlen(p) <= 1)
pg_fatal("%d: controldata retrieval problem\n", __LINE__);
op++; /* removing ':' char */
cluster->controldata.chkpnt_nxtxid = str2uint(op);
p++; /* removing ':' char */
cluster->controldata.chkpnt_nxtepoch = str2uint(p);
p = strchr(p, '/');
if (p == NULL || strlen(p) <= 1)
pg_fatal("%d: controldata retrieval problem\n", __LINE__);
p++; /* removing '/' char */
cluster->controldata.chkpnt_nxtxid = str2uint(p);
got_xid = true;
}
else if ((p = strstr(bufin, "Latest checkpoint's NextOID:")) != NULL)