1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-30 11:03:19 +03:00

pg_upgrade: preserve the timestamp epoch

This is useful for replication tools like Slony and Skytools.

Report by Sergey Konoplev
This commit is contained in:
Bruce Momjian
2014-09-05 19:19:41 -04:00
parent 1f4d1074c5
commit a74a4aa23b
4 changed files with 20 additions and 10 deletions

View File

@ -209,16 +209,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)