On Mon, Jan 18, 2016 at 07:50:12PM -0500, Bruce Momjian wrote: > > >>>> 1) Change NextXID output format from "%u/%u" to "%u:%u" > > >>>> (see recent hackers thread) > > >>> > > >>> ! printf(_("Latest checkpoint's NextXID: %u/%u\n"), > > >>> ControlFile.checkPointCopy.nextXidEpoch, > > >>> ControlFile.checkPointCopy.nextXid); > > >>> printf(_("Latest checkpoint's NextOID: %u\n"), > > >>> --- 646,652 ---- > > >>> ControlFile.checkPointCopy.ThisTimeLineID); > > >>> printf(_("Latest checkpoint's full_page_writes: %s\n"), > > >>> ControlFile.checkPointCopy.fullPageWrites ? _("on") : > > >>> _("off")); > > >>> ! printf(_("Latest checkpoint's NextXID: %u:%u\n"), > > >>> This should be definitely a separate patch. > > >> > > >> Ok. Notwithstanding Simon's reply, there seems to be consensus that this > > >> is the way to go. Will commit it this way unless some additional > > >> objections surface in the next day or so. > > > > > > FYI, this slash-colon change will break pg_upgrade unless it is patched. > > > Dp you want a patch from me? > > > > Didn't realize that -- yes please. > > Sure, attached, and it would be applied only to head, where you change > pg_controldata. pg_upgrade has to read the old and new cluster's > pg_controldata. We could get more sophisticated by checking the catalog > version number where the format was changed, but that doesn't seem worth > it, and is overly complex because we get the catalog version number from > pg_controldata, so you would be adding a dependency in ordering of the > pg_controldata entries.
Sorry, please use the attached patch instead, now tested with your changes. -- Bruce Momjian <br...@momjian.us> http://momjian.us EnterpriseDB http://enterprisedb.com + As you are, so once was I. As I am, so you will be. + + Roman grave inscription +
diff --git a/src/bin/pg_upgrade/controldata.c b/src/bin/pg_upgrade/controldata.c new file mode 100644 index 2def729..34e194c *** a/src/bin/pg_upgrade/controldata.c --- b/src/bin/pg_upgrade/controldata.c *************** get_control_data(ClusterInfo *cluster, b *** 197,207 **** p++; /* remove ':' 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++; /* remove '/' char */ cluster->controldata.chkpnt_nxtxid = str2uint(p); got_xid = true; } --- 197,214 ---- p++; /* remove ':' char */ cluster->controldata.chkpnt_nxtepoch = str2uint(p); ! if (strchr(p, '/') != NULL) ! p = strchr(p, '/'); ! /* delimiter changed from '/' to ':' in 9.6 */ ! else if (GET_MAJOR_VERSION(cluster->major_version) >= 906) ! p = strchr(p, ':'); ! else ! p = NULL; ! if (p == NULL || strlen(p) <= 1) pg_fatal("%d: controldata retrieval problem\n", __LINE__); ! p++; /* remove '/' or ':' char */ cluster->controldata.chkpnt_nxtxid = str2uint(p); got_xid = true; }
-- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers