]> granicus.if.org Git - postgresql/blob - src/bin/pg_upgrade/controldata.c
Update copyright via script for 2017
[postgresql] / src / bin / pg_upgrade / controldata.c
1 /*
2  *      controldata.c
3  *
4  *      controldata functions
5  *
6  *      Copyright (c) 2010-2017, PostgreSQL Global Development Group
7  *      src/bin/pg_upgrade/controldata.c
8  */
9
10 #include "postgres_fe.h"
11
12 #include "pg_upgrade.h"
13
14 #include <ctype.h>
15
16 /*
17  * get_control_data()
18  *
19  * gets pg_control information in "ctrl". Assumes that bindir and
20  * datadir are valid absolute paths to postgresql bin and pgdata
21  * directories respectively *and* pg_resetxlog is version compatible
22  * with datadir. The main purpose of this function is to get pg_control
23  * data in a version independent manner.
24  *
25  * The approach taken here is to invoke pg_resetxlog with -n option
26  * and then pipe its output. With little string parsing we get the
27  * pg_control data.  pg_resetxlog cannot be run while the server is running
28  * so we use pg_controldata;  pg_controldata doesn't provide all the fields
29  * we need to actually perform the upgrade, but it provides enough for
30  * check mode.  We do not implement pg_resetxlog -n because it is hard to
31  * return valid xid data for a running server.
32  */
33 void
34 get_control_data(ClusterInfo *cluster, bool live_check)
35 {
36         char            cmd[MAXPGPATH];
37         char            bufin[MAX_STRING];
38         FILE       *output;
39         char       *p;
40         bool            got_tli = false;
41         bool            got_log_id = false;
42         bool            got_log_seg = false;
43         bool            got_xid = false;
44         bool            got_oid = false;
45         bool            got_multi = false;
46         bool            got_oldestmulti = false;
47         bool            got_mxoff = false;
48         bool            got_nextxlogfile = false;
49         bool            got_float8_pass_by_value = false;
50         bool            got_align = false;
51         bool            got_blocksz = false;
52         bool            got_largesz = false;
53         bool            got_walsz = false;
54         bool            got_walseg = false;
55         bool            got_ident = false;
56         bool            got_index = false;
57         bool            got_toast = false;
58         bool            got_large_object = false;
59         bool            got_date_is_int = false;
60         bool            got_data_checksum_version = false;
61         char       *lc_collate = NULL;
62         char       *lc_ctype = NULL;
63         char       *lc_monetary = NULL;
64         char       *lc_numeric = NULL;
65         char       *lc_time = NULL;
66         char       *lang = NULL;
67         char       *language = NULL;
68         char       *lc_all = NULL;
69         char       *lc_messages = NULL;
70         uint32          tli = 0;
71         uint32          logid = 0;
72         uint32          segno = 0;
73
74
75         /*
76          * Because we test the pg_resetxlog output as strings, it has to be in
77          * English.  Copied from pg_regress.c.
78          */
79         if (getenv("LC_COLLATE"))
80                 lc_collate = pg_strdup(getenv("LC_COLLATE"));
81         if (getenv("LC_CTYPE"))
82                 lc_ctype = pg_strdup(getenv("LC_CTYPE"));
83         if (getenv("LC_MONETARY"))
84                 lc_monetary = pg_strdup(getenv("LC_MONETARY"));
85         if (getenv("LC_NUMERIC"))
86                 lc_numeric = pg_strdup(getenv("LC_NUMERIC"));
87         if (getenv("LC_TIME"))
88                 lc_time = pg_strdup(getenv("LC_TIME"));
89         if (getenv("LANG"))
90                 lang = pg_strdup(getenv("LANG"));
91         if (getenv("LANGUAGE"))
92                 language = pg_strdup(getenv("LANGUAGE"));
93         if (getenv("LC_ALL"))
94                 lc_all = pg_strdup(getenv("LC_ALL"));
95         if (getenv("LC_MESSAGES"))
96                 lc_messages = pg_strdup(getenv("LC_MESSAGES"));
97
98         pg_putenv("LC_COLLATE", NULL);
99         pg_putenv("LC_CTYPE", NULL);
100         pg_putenv("LC_MONETARY", NULL);
101         pg_putenv("LC_NUMERIC", NULL);
102         pg_putenv("LC_TIME", NULL);
103         pg_putenv("LANG",
104 #ifndef WIN32
105                           NULL);
106 #else
107         /* On Windows the default locale cannot be English, so force it */
108                           "en");
109 #endif
110         pg_putenv("LANGUAGE", NULL);
111         pg_putenv("LC_ALL", NULL);
112         pg_putenv("LC_MESSAGES", "C");
113
114         snprintf(cmd, sizeof(cmd), "\"%s/%s \"%s\"",
115                          cluster->bindir,
116                          live_check ? "pg_controldata\"" : "pg_resetxlog\" -n",
117                          cluster->pgdata);
118         fflush(stdout);
119         fflush(stderr);
120
121         if ((output = popen(cmd, "r")) == NULL)
122                 pg_fatal("could not get control data using %s: %s\n",
123                                  cmd, strerror(errno));
124
125         /* Only in <= 9.2 */
126         if (GET_MAJOR_VERSION(cluster->major_version) <= 902)
127         {
128                 cluster->controldata.data_checksum_version = 0;
129                 got_data_checksum_version = true;
130         }
131
132         /* we have the result of cmd in "output". so parse it line by line now */
133         while (fgets(bufin, sizeof(bufin), output))
134         {
135                 pg_log(PG_VERBOSE, "%s", bufin);
136
137                 if ((p = strstr(bufin, "pg_control version number:")) != NULL)
138                 {
139                         p = strchr(p, ':');
140
141                         if (p == NULL || strlen(p) <= 1)
142                                 pg_fatal("%d: pg_resetxlog problem\n", __LINE__);
143
144                         p++;                            /* remove ':' char */
145                         cluster->controldata.ctrl_ver = str2uint(p);
146                 }
147                 else if ((p = strstr(bufin, "Catalog version number:")) != NULL)
148                 {
149                         p = strchr(p, ':');
150
151                         if (p == NULL || strlen(p) <= 1)
152                                 pg_fatal("%d: controldata retrieval problem\n", __LINE__);
153
154                         p++;                            /* remove ':' char */
155                         cluster->controldata.cat_ver = str2uint(p);
156                 }
157                 else if ((p = strstr(bufin, "Latest checkpoint's TimeLineID:")) != NULL)
158                 {
159                         p = strchr(p, ':');
160
161                         if (p == NULL || strlen(p) <= 1)
162                                 pg_fatal("%d: controldata retrieval problem\n", __LINE__);
163
164                         p++;                            /* remove ':' char */
165                         tli = str2uint(p);
166                         got_tli = true;
167                 }
168                 else if ((p = strstr(bufin, "First log file ID after reset:")) != NULL)
169                 {
170                         p = strchr(p, ':');
171
172                         if (p == NULL || strlen(p) <= 1)
173                                 pg_fatal("%d: controldata retrieval problem\n", __LINE__);
174
175                         p++;                            /* remove ':' char */
176                         logid = str2uint(p);
177                         got_log_id = true;
178                 }
179                 else if ((p = strstr(bufin, "First log file segment after reset:")) != NULL)
180                 {
181                         p = strchr(p, ':');
182
183                         if (p == NULL || strlen(p) <= 1)
184                                 pg_fatal("%d: controldata retrieval problem\n", __LINE__);
185
186                         p++;                            /* remove ':' char */
187                         segno = str2uint(p);
188                         got_log_seg = true;
189                 }
190                 else if ((p = strstr(bufin, "Latest checkpoint's NextXID:")) != NULL)
191                 {
192                         p = strchr(p, ':');
193
194                         if (p == NULL || strlen(p) <= 1)
195                                 pg_fatal("%d: controldata retrieval problem\n", __LINE__);
196
197                         p++;                            /* remove ':' char */
198                         cluster->controldata.chkpnt_nxtepoch = str2uint(p);
199
200                         /*
201                          * Delimiter changed from '/' to ':' in 9.6.  We don't test for
202                          * the catalog version of the change because the catalog version
203                          * is pulled from pg_controldata too, and it isn't worth adding an
204                          * order dependency for this --- we just check the string.
205                          */
206                         if (strchr(p, '/') != NULL)
207                                 p = strchr(p, '/');
208                         else if (GET_MAJOR_VERSION(cluster->major_version) >= 906)
209                                 p = strchr(p, ':');
210                         else
211                                 p = NULL;
212
213                         if (p == NULL || strlen(p) <= 1)
214                                 pg_fatal("%d: controldata retrieval problem\n", __LINE__);
215
216                         p++;                            /* remove '/' or ':' char */
217                         cluster->controldata.chkpnt_nxtxid = str2uint(p);
218                         got_xid = true;
219                 }
220                 else if ((p = strstr(bufin, "Latest checkpoint's NextOID:")) != NULL)
221                 {
222                         p = strchr(p, ':');
223
224                         if (p == NULL || strlen(p) <= 1)
225                                 pg_fatal("%d: controldata retrieval problem\n", __LINE__);
226
227                         p++;                            /* remove ':' char */
228                         cluster->controldata.chkpnt_nxtoid = str2uint(p);
229                         got_oid = true;
230                 }
231                 else if ((p = strstr(bufin, "Latest checkpoint's NextMultiXactId:")) != NULL)
232                 {
233                         p = strchr(p, ':');
234
235                         if (p == NULL || strlen(p) <= 1)
236                                 pg_fatal("%d: controldata retrieval problem\n", __LINE__);
237
238                         p++;                            /* remove ':' char */
239                         cluster->controldata.chkpnt_nxtmulti = str2uint(p);
240                         got_multi = true;
241                 }
242                 else if ((p = strstr(bufin, "Latest checkpoint's oldestMultiXid:")) != NULL)
243                 {
244                         p = strchr(p, ':');
245
246                         if (p == NULL || strlen(p) <= 1)
247                                 pg_fatal("%d: controldata retrieval problem\n", __LINE__);
248
249                         p++;                            /* remove ':' char */
250                         cluster->controldata.chkpnt_oldstMulti = str2uint(p);
251                         got_oldestmulti = true;
252                 }
253                 else if ((p = strstr(bufin, "Latest checkpoint's NextMultiOffset:")) != NULL)
254                 {
255                         p = strchr(p, ':');
256
257                         if (p == NULL || strlen(p) <= 1)
258                                 pg_fatal("%d: controldata retrieval problem\n", __LINE__);
259
260                         p++;                            /* remove ':' char */
261                         cluster->controldata.chkpnt_nxtmxoff = str2uint(p);
262                         got_mxoff = true;
263                 }
264                 else if ((p = strstr(bufin, "First log segment after reset:")) != NULL)
265                 {
266                         /* Skip the colon and any whitespace after it */
267                         p = strchr(p, ':');
268                         if (p == NULL || strlen(p) <= 1)
269                                 pg_fatal("%d: controldata retrieval problem\n", __LINE__);
270                         p = strpbrk(p, "01234567890ABCDEF");
271                         if (p == NULL || strlen(p) <= 1)
272                                 pg_fatal("%d: controldata retrieval problem\n", __LINE__);
273
274                         /* Make sure it looks like a valid WAL file name */
275                         if (strspn(p, "0123456789ABCDEF") != 24)
276                                 pg_fatal("%d: controldata retrieval problem\n", __LINE__);
277
278                         strlcpy(cluster->controldata.nextxlogfile, p, 25);
279                         got_nextxlogfile = true;
280                 }
281                 else if ((p = strstr(bufin, "Float8 argument passing:")) != NULL)
282                 {
283                         p = strchr(p, ':');
284
285                         if (p == NULL || strlen(p) <= 1)
286                                 pg_fatal("%d: controldata retrieval problem\n", __LINE__);
287
288                         p++;                            /* remove ':' char */
289                         /* used later for contrib check */
290                         cluster->controldata.float8_pass_by_value = strstr(p, "by value") != NULL;
291                         got_float8_pass_by_value = true;
292                 }
293                 else if ((p = strstr(bufin, "Maximum data alignment:")) != NULL)
294                 {
295                         p = strchr(p, ':');
296
297                         if (p == NULL || strlen(p) <= 1)
298                                 pg_fatal("%d: controldata retrieval problem\n", __LINE__);
299
300                         p++;                            /* remove ':' char */
301                         cluster->controldata.align = str2uint(p);
302                         got_align = true;
303                 }
304                 else if ((p = strstr(bufin, "Database block size:")) != NULL)
305                 {
306                         p = strchr(p, ':');
307
308                         if (p == NULL || strlen(p) <= 1)
309                                 pg_fatal("%d: controldata retrieval problem\n", __LINE__);
310
311                         p++;                            /* remove ':' char */
312                         cluster->controldata.blocksz = str2uint(p);
313                         got_blocksz = true;
314                 }
315                 else if ((p = strstr(bufin, "Blocks per segment of large relation:")) != NULL)
316                 {
317                         p = strchr(p, ':');
318
319                         if (p == NULL || strlen(p) <= 1)
320                                 pg_fatal("%d: controldata retrieval problem\n", __LINE__);
321
322                         p++;                            /* remove ':' char */
323                         cluster->controldata.largesz = str2uint(p);
324                         got_largesz = true;
325                 }
326                 else if ((p = strstr(bufin, "WAL block size:")) != NULL)
327                 {
328                         p = strchr(p, ':');
329
330                         if (p == NULL || strlen(p) <= 1)
331                                 pg_fatal("%d: controldata retrieval problem\n", __LINE__);
332
333                         p++;                            /* remove ':' char */
334                         cluster->controldata.walsz = str2uint(p);
335                         got_walsz = true;
336                 }
337                 else if ((p = strstr(bufin, "Bytes per WAL segment:")) != NULL)
338                 {
339                         p = strchr(p, ':');
340
341                         if (p == NULL || strlen(p) <= 1)
342                                 pg_fatal("%d: controldata retrieval problem\n", __LINE__);
343
344                         p++;                            /* remove ':' char */
345                         cluster->controldata.walseg = str2uint(p);
346                         got_walseg = true;
347                 }
348                 else if ((p = strstr(bufin, "Maximum length of identifiers:")) != NULL)
349                 {
350                         p = strchr(p, ':');
351
352                         if (p == NULL || strlen(p) <= 1)
353                                 pg_fatal("%d: controldata retrieval problem\n", __LINE__);
354
355                         p++;                            /* remove ':' char */
356                         cluster->controldata.ident = str2uint(p);
357                         got_ident = true;
358                 }
359                 else if ((p = strstr(bufin, "Maximum columns in an index:")) != NULL)
360                 {
361                         p = strchr(p, ':');
362
363                         if (p == NULL || strlen(p) <= 1)
364                                 pg_fatal("%d: controldata retrieval problem\n", __LINE__);
365
366                         p++;                            /* remove ':' char */
367                         cluster->controldata.index = str2uint(p);
368                         got_index = true;
369                 }
370                 else if ((p = strstr(bufin, "Maximum size of a TOAST chunk:")) != NULL)
371                 {
372                         p = strchr(p, ':');
373
374                         if (p == NULL || strlen(p) <= 1)
375                                 pg_fatal("%d: controldata retrieval problem\n", __LINE__);
376
377                         p++;                            /* remove ':' char */
378                         cluster->controldata.toast = str2uint(p);
379                         got_toast = true;
380                 }
381                 else if ((p = strstr(bufin, "Size of a large-object chunk:")) != NULL)
382                 {
383                         p = strchr(p, ':');
384
385                         if (p == NULL || strlen(p) <= 1)
386                                 pg_fatal("%d: controldata retrieval problem\n", __LINE__);
387
388                         p++;                            /* remove ':' char */
389                         cluster->controldata.large_object = str2uint(p);
390                         got_large_object = true;
391                 }
392                 else if ((p = strstr(bufin, "Date/time type storage:")) != NULL)
393                 {
394                         p = strchr(p, ':');
395
396                         if (p == NULL || strlen(p) <= 1)
397                                 pg_fatal("%d: controldata retrieval problem\n", __LINE__);
398
399                         p++;                            /* remove ':' char */
400                         cluster->controldata.date_is_int = strstr(p, "64-bit integers") != NULL;
401                         got_date_is_int = true;
402                 }
403                 else if ((p = strstr(bufin, "checksum")) != NULL)
404                 {
405                         p = strchr(p, ':');
406
407                         if (p == NULL || strlen(p) <= 1)
408                                 pg_fatal("%d: controldata retrieval problem\n", __LINE__);
409
410                         p++;                            /* remove ':' char */
411                         /* used later for contrib check */
412                         cluster->controldata.data_checksum_version = str2uint(p);
413                         got_data_checksum_version = true;
414                 }
415         }
416
417         pclose(output);
418
419         /*
420          * Restore environment variables
421          */
422         pg_putenv("LC_COLLATE", lc_collate);
423         pg_putenv("LC_CTYPE", lc_ctype);
424         pg_putenv("LC_MONETARY", lc_monetary);
425         pg_putenv("LC_NUMERIC", lc_numeric);
426         pg_putenv("LC_TIME", lc_time);
427         pg_putenv("LANG", lang);
428         pg_putenv("LANGUAGE", language);
429         pg_putenv("LC_ALL", lc_all);
430         pg_putenv("LC_MESSAGES", lc_messages);
431
432         pg_free(lc_collate);
433         pg_free(lc_ctype);
434         pg_free(lc_monetary);
435         pg_free(lc_numeric);
436         pg_free(lc_time);
437         pg_free(lang);
438         pg_free(language);
439         pg_free(lc_all);
440         pg_free(lc_messages);
441
442         /*
443          * Before 9.3, pg_resetxlog reported the xlogid and segno of the first log
444          * file after reset as separate lines. Starting with 9.3, it reports the
445          * WAL file name. If the old cluster is older than 9.3, we construct the
446          * WAL file name from the xlogid and segno.
447          */
448         if (GET_MAJOR_VERSION(cluster->major_version) <= 902)
449         {
450                 if (got_tli && got_log_id && got_log_seg)
451                 {
452                         snprintf(cluster->controldata.nextxlogfile, 25, "%08X%08X%08X",
453                                          tli, logid, segno);
454                         got_nextxlogfile = true;
455                 }
456         }
457
458         /* verify that we got all the mandatory pg_control data */
459         if (!got_xid || !got_oid ||
460                 !got_multi ||
461                 (!got_oldestmulti &&
462                  cluster->controldata.cat_ver >= MULTIXACT_FORMATCHANGE_CAT_VER) ||
463                 !got_mxoff || (!live_check && !got_nextxlogfile) ||
464                 !got_float8_pass_by_value || !got_align || !got_blocksz ||
465                 !got_largesz || !got_walsz || !got_walseg || !got_ident ||
466                 !got_index || !got_toast ||
467                 (!got_large_object &&
468                  cluster->controldata.ctrl_ver >= LARGE_OBJECT_SIZE_PG_CONTROL_VER) ||
469                 !got_date_is_int || !got_data_checksum_version)
470         {
471                 pg_log(PG_REPORT,
472                            "The %s cluster lacks some required control information:\n",
473                            CLUSTER_NAME(cluster));
474
475                 if (!got_xid)
476                         pg_log(PG_REPORT, "  checkpoint next XID\n");
477
478                 if (!got_oid)
479                         pg_log(PG_REPORT, "  latest checkpoint next OID\n");
480
481                 if (!got_multi)
482                         pg_log(PG_REPORT, "  latest checkpoint next MultiXactId\n");
483
484                 if (!got_oldestmulti &&
485                         cluster->controldata.cat_ver >= MULTIXACT_FORMATCHANGE_CAT_VER)
486                         pg_log(PG_REPORT, "  latest checkpoint oldest MultiXactId\n");
487
488                 if (!got_mxoff)
489                         pg_log(PG_REPORT, "  latest checkpoint next MultiXactOffset\n");
490
491                 if (!live_check && !got_nextxlogfile)
492                         pg_log(PG_REPORT, "  first WAL segment after reset\n");
493
494                 if (!got_float8_pass_by_value)
495                         pg_log(PG_REPORT, "  float8 argument passing method\n");
496
497                 if (!got_align)
498                         pg_log(PG_REPORT, "  maximum alignment\n");
499
500                 if (!got_blocksz)
501                         pg_log(PG_REPORT, "  block size\n");
502
503                 if (!got_largesz)
504                         pg_log(PG_REPORT, "  large relation segment size\n");
505
506                 if (!got_walsz)
507                         pg_log(PG_REPORT, "  WAL block size\n");
508
509                 if (!got_walseg)
510                         pg_log(PG_REPORT, "  WAL segment size\n");
511
512                 if (!got_ident)
513                         pg_log(PG_REPORT, "  maximum identifier length\n");
514
515                 if (!got_index)
516                         pg_log(PG_REPORT, "  maximum number of indexed columns\n");
517
518                 if (!got_toast)
519                         pg_log(PG_REPORT, "  maximum TOAST chunk size\n");
520
521                 if (!got_large_object &&
522                         cluster->controldata.ctrl_ver >= LARGE_OBJECT_SIZE_PG_CONTROL_VER)
523                         pg_log(PG_REPORT, "  large-object chunk size\n");
524
525                 if (!got_date_is_int)
526                         pg_log(PG_REPORT, "  dates/times are integers?\n");
527
528                 /* value added in Postgres 9.3 */
529                 if (!got_data_checksum_version)
530                         pg_log(PG_REPORT, "  data checksum version\n");
531
532                 pg_fatal("Cannot continue without required control information, terminating\n");
533         }
534 }
535
536
537 /*
538  * check_control_data()
539  *
540  * check to make sure the control data settings are compatible
541  */
542 void
543 check_control_data(ControlData *oldctrl,
544                                    ControlData *newctrl)
545 {
546         if (oldctrl->align == 0 || oldctrl->align != newctrl->align)
547                 pg_fatal("old and new pg_controldata alignments are invalid or do not match\n"
548                            "Likely one cluster is a 32-bit install, the other 64-bit\n");
549
550         if (oldctrl->blocksz == 0 || oldctrl->blocksz != newctrl->blocksz)
551                 pg_fatal("old and new pg_controldata block sizes are invalid or do not match\n");
552
553         if (oldctrl->largesz == 0 || oldctrl->largesz != newctrl->largesz)
554                 pg_fatal("old and new pg_controldata maximum relation segment sizes are invalid or do not match\n");
555
556         if (oldctrl->walsz == 0 || oldctrl->walsz != newctrl->walsz)
557                 pg_fatal("old and new pg_controldata WAL block sizes are invalid or do not match\n");
558
559         if (oldctrl->walseg == 0 || oldctrl->walseg != newctrl->walseg)
560                 pg_fatal("old and new pg_controldata WAL segment sizes are invalid or do not match\n");
561
562         if (oldctrl->ident == 0 || oldctrl->ident != newctrl->ident)
563                 pg_fatal("old and new pg_controldata maximum identifier lengths are invalid or do not match\n");
564
565         if (oldctrl->index == 0 || oldctrl->index != newctrl->index)
566                 pg_fatal("old and new pg_controldata maximum indexed columns are invalid or do not match\n");
567
568         if (oldctrl->toast == 0 || oldctrl->toast != newctrl->toast)
569                 pg_fatal("old and new pg_controldata maximum TOAST chunk sizes are invalid or do not match\n");
570
571         /* large_object added in 9.5, so it might not exist in the old cluster */
572         if (oldctrl->large_object != 0 &&
573                 oldctrl->large_object != newctrl->large_object)
574                 pg_fatal("old and new pg_controldata large-object chunk sizes are invalid or do not match\n");
575
576         if (oldctrl->date_is_int != newctrl->date_is_int)
577                 pg_fatal("old and new pg_controldata date/time storage types do not match\n");
578
579         /*
580          * float8_pass_by_value does not need to match, but is used in
581          * check_for_isn_and_int8_passing_mismatch().
582          */
583
584         /*
585          * We might eventually allow upgrades from checksum to no-checksum
586          * clusters.
587          */
588         if (oldctrl->data_checksum_version == 0 &&
589                 newctrl->data_checksum_version != 0)
590                 pg_fatal("old cluster does not use data checksums but the new one does\n");
591         else if (oldctrl->data_checksum_version != 0 &&
592                          newctrl->data_checksum_version == 0)
593                 pg_fatal("old cluster uses data checksums but the new one does not\n");
594         else if (oldctrl->data_checksum_version != newctrl->data_checksum_version)
595                 pg_fatal("old and new cluster pg_controldata checksum versions do not match\n");
596 }
597
598
599 void
600 disable_old_cluster(void)
601 {
602         char            old_path[MAXPGPATH],
603                                 new_path[MAXPGPATH];
604
605         /* rename pg_control so old server cannot be accidentally started */
606         prep_status("Adding \".old\" suffix to old global/pg_control");
607
608         snprintf(old_path, sizeof(old_path), "%s/global/pg_control", old_cluster.pgdata);
609         snprintf(new_path, sizeof(new_path), "%s/global/pg_control.old", old_cluster.pgdata);
610         if (pg_mv_file(old_path, new_path) != 0)
611                 pg_fatal("Unable to rename %s to %s.\n", old_path, new_path);
612         check_ok();
613
614         pg_log(PG_REPORT, "\n"
615                    "If you want to start the old cluster, you will need to remove\n"
616                    "the \".old\" suffix from %s/global/pg_control.old.\n"
617                  "Because \"link\" mode was used, the old cluster cannot be safely\n"
618         "started once the new cluster has been started.\n\n", old_cluster.pgdata);
619 }