PostgreSQL Source Code  git master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
controldata.c File Reference
#include "postgres_fe.h"
#include "pg_upgrade.h"
#include <ctype.h>
Include dependency graph for controldata.c:

Go to the source code of this file.

Functions

void get_control_data (ClusterInfo *cluster, bool live_check)
 
void check_control_data (ControlData *oldctrl, ControlData *newctrl)
 
void disable_old_cluster (void)
 

Function Documentation

void check_control_data ( ControlData oldctrl,
ControlData newctrl 
)

Definition at line 549 of file controldata.c.

References ControlData::align, ControlData::blocksz, ControlData::data_checksum_version, ControlData::date_is_int, ControlData::ident, ControlData::index, ControlData::large_object, ControlData::largesz, pg_fatal(), ControlData::toast, ControlData::walseg, and ControlData::walsz.

Referenced by check_cluster_compatibility().

551 {
552  if (oldctrl->align == 0 || oldctrl->align != newctrl->align)
553  pg_fatal("old and new pg_controldata alignments are invalid or do not match\n"
554  "Likely one cluster is a 32-bit install, the other 64-bit\n");
555 
556  if (oldctrl->blocksz == 0 || oldctrl->blocksz != newctrl->blocksz)
557  pg_fatal("old and new pg_controldata block sizes are invalid or do not match\n");
558 
559  if (oldctrl->largesz == 0 || oldctrl->largesz != newctrl->largesz)
560  pg_fatal("old and new pg_controldata maximum relation segment sizes are invalid or do not match\n");
561 
562  if (oldctrl->walsz == 0 || oldctrl->walsz != newctrl->walsz)
563  pg_fatal("old and new pg_controldata WAL block sizes are invalid or do not match\n");
564 
565  if (oldctrl->walseg == 0 || oldctrl->walseg != newctrl->walseg)
566  pg_fatal("old and new pg_controldata WAL segment sizes are invalid or do not match\n");
567 
568  if (oldctrl->ident == 0 || oldctrl->ident != newctrl->ident)
569  pg_fatal("old and new pg_controldata maximum identifier lengths are invalid or do not match\n");
570 
571  if (oldctrl->index == 0 || oldctrl->index != newctrl->index)
572  pg_fatal("old and new pg_controldata maximum indexed columns are invalid or do not match\n");
573 
574  if (oldctrl->toast == 0 || oldctrl->toast != newctrl->toast)
575  pg_fatal("old and new pg_controldata maximum TOAST chunk sizes are invalid or do not match\n");
576 
577  /* large_object added in 9.5, so it might not exist in the old cluster */
578  if (oldctrl->large_object != 0 &&
579  oldctrl->large_object != newctrl->large_object)
580  pg_fatal("old and new pg_controldata large-object chunk sizes are invalid or do not match\n");
581 
582  if (oldctrl->date_is_int != newctrl->date_is_int)
583  pg_fatal("old and new pg_controldata date/time storage types do not match\n");
584 
585  /*
586  * float8_pass_by_value does not need to match, but is used in
587  * check_for_isn_and_int8_passing_mismatch().
588  */
589 
590  /*
591  * We might eventually allow upgrades from checksum to no-checksum
592  * clusters.
593  */
594  if (oldctrl->data_checksum_version == 0 &&
595  newctrl->data_checksum_version != 0)
596  pg_fatal("old cluster does not use data checksums but the new one does\n");
597  else if (oldctrl->data_checksum_version != 0 &&
598  newctrl->data_checksum_version == 0)
599  pg_fatal("old cluster uses data checksums but the new one does not\n");
600  else if (oldctrl->data_checksum_version != newctrl->data_checksum_version)
601  pg_fatal("old and new cluster pg_controldata checksum versions do not match\n");
602 }
bool date_is_int
Definition: pg_upgrade.h:225
uint32 walsz
Definition: pg_upgrade.h:219
void pg_fatal(const char *fmt,...)
Definition: logging.c:83
uint32 index
Definition: pg_upgrade.h:222
uint32 blocksz
Definition: pg_upgrade.h:217
bool data_checksum_version
Definition: pg_upgrade.h:227
uint32 ident
Definition: pg_upgrade.h:221
uint32 align
Definition: pg_upgrade.h:216
uint32 walseg
Definition: pg_upgrade.h:220
uint32 largesz
Definition: pg_upgrade.h:218
uint32 toast
Definition: pg_upgrade.h:223
uint32 large_object
Definition: pg_upgrade.h:224
void disable_old_cluster ( void  )

Definition at line 606 of file controldata.c.

References check_ok(), MAXPGPATH, old_cluster, pg_fatal(), pg_log(), pg_mv_file, PG_REPORT, ClusterInfo::pgdata, prep_status(), and snprintf().

Referenced by main().

607 {
608  char old_path[MAXPGPATH],
609  new_path[MAXPGPATH];
610 
611  /* rename pg_control so old server cannot be accidentally started */
612  prep_status("Adding \".old\" suffix to old global/pg_control");
613 
614  snprintf(old_path, sizeof(old_path), "%s/global/pg_control", old_cluster.pgdata);
615  snprintf(new_path, sizeof(new_path), "%s/global/pg_control.old", old_cluster.pgdata);
616  if (pg_mv_file(old_path, new_path) != 0)
617  pg_fatal("Unable to rename %s to %s.\n", old_path, new_path);
618  check_ok();
619 
620  pg_log(PG_REPORT, "\n"
621  "If you want to start the old cluster, you will need to remove\n"
622  "the \".old\" suffix from %s/global/pg_control.old.\n"
623  "Because \"link\" mode was used, the old cluster cannot be safely\n"
624  "started once the new cluster has been started.\n\n", old_cluster.pgdata);
625 }
int snprintf(char *str, size_t count, const char *fmt,...) pg_attribute_printf(3
void pg_fatal(const char *fmt,...)
Definition: logging.c:83
#define MAXPGPATH
void prep_status(const char *fmt,...) pg_attribute_printf(1
ClusterInfo old_cluster
Definition: pg_upgrade.c:56
void pg_log(eLogType type, const char *fmt,...)
Definition: logging.c:69
static void check_ok(void)
Definition: initdb.c:2008
char * pgdata
Definition: pg_upgrade.h:264
#define pg_mv_file
Definition: pg_upgrade.h:73
void get_control_data ( ClusterInfo cluster,
bool  live_check 
)

Definition at line 34 of file controldata.c.

References ControlData::align, ClusterInfo::bin_version, ClusterInfo::bindir, ControlData::blocksz, ControlData::cat_ver, ControlData::chkpnt_nxtepoch, ControlData::chkpnt_nxtmulti, ControlData::chkpnt_nxtmxoff, ControlData::chkpnt_nxtoid, ControlData::chkpnt_nxtxid, ControlData::chkpnt_oldstMulti, CLUSTER_NAME, ClusterInfo::controldata, ControlData::ctrl_ver, ControlData::data_checksum_version, ControlData::date_is_int, ControlData::float8_pass_by_value, GET_MAJOR_VERSION, ControlData::ident, ControlData::index, ControlData::large_object, LARGE_OBJECT_SIZE_PG_CONTROL_VER, ControlData::largesz, lc_collate, lc_ctype, lc_messages, lc_monetary, lc_numeric, lc_time, ClusterInfo::major_version, MAX_STRING, MAXPGPATH, MULTIXACT_FORMATCHANGE_CAT_VER, ControlData::nextxlogfile, NULL, output(), pg_fatal(), pg_free(), pg_log(), pg_putenv(), PG_REPORT, pg_strdup(), PG_VERBOSE, ClusterInfo::pgdata, snprintf(), str2uint(), strerror(), strlcpy(), ControlData::toast, ControlData::walseg, and ControlData::walsz.

Referenced by check_cluster_compatibility().

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  char *resetwal_bin;
74 
75 
76  /*
77  * Because we test the pg_resetwal output as strings, it has to be in
78  * English. Copied from pg_regress.c.
79  */
80  if (getenv("LC_COLLATE"))
81  lc_collate = pg_strdup(getenv("LC_COLLATE"));
82  if (getenv("LC_CTYPE"))
83  lc_ctype = pg_strdup(getenv("LC_CTYPE"));
84  if (getenv("LC_MONETARY"))
85  lc_monetary = pg_strdup(getenv("LC_MONETARY"));
86  if (getenv("LC_NUMERIC"))
87  lc_numeric = pg_strdup(getenv("LC_NUMERIC"));
88  if (getenv("LC_TIME"))
89  lc_time = pg_strdup(getenv("LC_TIME"));
90  if (getenv("LANG"))
91  lang = pg_strdup(getenv("LANG"));
92  if (getenv("LANGUAGE"))
93  language = pg_strdup(getenv("LANGUAGE"));
94  if (getenv("LC_ALL"))
95  lc_all = pg_strdup(getenv("LC_ALL"));
96  if (getenv("LC_MESSAGES"))
97  lc_messages = pg_strdup(getenv("LC_MESSAGES"));
98 
99  pg_putenv("LC_COLLATE", NULL);
100  pg_putenv("LC_CTYPE", NULL);
101  pg_putenv("LC_MONETARY", NULL);
102  pg_putenv("LC_NUMERIC", NULL);
103  pg_putenv("LC_TIME", NULL);
104  pg_putenv("LANG",
105 #ifndef WIN32
106  NULL);
107 #else
108  /* On Windows the default locale cannot be English, so force it */
109  "en");
110 #endif
111  pg_putenv("LANGUAGE", NULL);
112  pg_putenv("LC_ALL", NULL);
113  pg_putenv("LC_MESSAGES", "C");
114 
115  /* pg_resetxlog has been renamed to pg_resetwal in version 10 */
116  if (GET_MAJOR_VERSION(cluster->bin_version) < 1000)
117  resetwal_bin = "pg_resetxlog\" -n";
118  else
119  resetwal_bin = "pg_resetwal\" -n";
120  snprintf(cmd, sizeof(cmd), "\"%s/%s \"%s\"",
121  cluster->bindir,
122  live_check ? "pg_controldata\"" : resetwal_bin,
123  cluster->pgdata);
124  fflush(stdout);
125  fflush(stderr);
126 
127  if ((output = popen(cmd, "r")) == NULL)
128  pg_fatal("could not get control data using %s: %s\n",
129  cmd, strerror(errno));
130 
131  /* Only in <= 9.2 */
132  if (GET_MAJOR_VERSION(cluster->major_version) <= 902)
133  {
134  cluster->controldata.data_checksum_version = 0;
135  got_data_checksum_version = true;
136  }
137 
138  /* we have the result of cmd in "output". so parse it line by line now */
139  while (fgets(bufin, sizeof(bufin), output))
140  {
141  pg_log(PG_VERBOSE, "%s", bufin);
142 
143  if ((p = strstr(bufin, "pg_control version number:")) != NULL)
144  {
145  p = strchr(p, ':');
146 
147  if (p == NULL || strlen(p) <= 1)
148  pg_fatal("%d: pg_resetwal problem\n", __LINE__);
149 
150  p++; /* remove ':' char */
151  cluster->controldata.ctrl_ver = str2uint(p);
152  }
153  else if ((p = strstr(bufin, "Catalog version number:")) != NULL)
154  {
155  p = strchr(p, ':');
156 
157  if (p == NULL || strlen(p) <= 1)
158  pg_fatal("%d: controldata retrieval problem\n", __LINE__);
159 
160  p++; /* remove ':' char */
161  cluster->controldata.cat_ver = str2uint(p);
162  }
163  else if ((p = strstr(bufin, "Latest checkpoint's TimeLineID:")) != NULL)
164  {
165  p = strchr(p, ':');
166 
167  if (p == NULL || strlen(p) <= 1)
168  pg_fatal("%d: controldata retrieval problem\n", __LINE__);
169 
170  p++; /* remove ':' char */
171  tli = str2uint(p);
172  got_tli = true;
173  }
174  else if ((p = strstr(bufin, "First log file ID after reset:")) != NULL)
175  {
176  p = strchr(p, ':');
177 
178  if (p == NULL || strlen(p) <= 1)
179  pg_fatal("%d: controldata retrieval problem\n", __LINE__);
180 
181  p++; /* remove ':' char */
182  logid = str2uint(p);
183  got_log_id = true;
184  }
185  else if ((p = strstr(bufin, "First log file segment after reset:")) != NULL)
186  {
187  p = strchr(p, ':');
188 
189  if (p == NULL || strlen(p) <= 1)
190  pg_fatal("%d: controldata retrieval problem\n", __LINE__);
191 
192  p++; /* remove ':' char */
193  segno = str2uint(p);
194  got_log_seg = true;
195  }
196  else if ((p = strstr(bufin, "Latest checkpoint's NextXID:")) != NULL)
197  {
198  p = strchr(p, ':');
199 
200  if (p == NULL || strlen(p) <= 1)
201  pg_fatal("%d: controldata retrieval problem\n", __LINE__);
202 
203  p++; /* remove ':' char */
204  cluster->controldata.chkpnt_nxtepoch = str2uint(p);
205 
206  /*
207  * Delimiter changed from '/' to ':' in 9.6. We don't test for
208  * the catalog version of the change because the catalog version
209  * is pulled from pg_controldata too, and it isn't worth adding an
210  * order dependency for this --- we just check the string.
211  */
212  if (strchr(p, '/') != NULL)
213  p = strchr(p, '/');
214  else if (GET_MAJOR_VERSION(cluster->major_version) >= 906)
215  p = strchr(p, ':');
216  else
217  p = NULL;
218 
219  if (p == NULL || strlen(p) <= 1)
220  pg_fatal("%d: controldata retrieval problem\n", __LINE__);
221 
222  p++; /* remove '/' or ':' char */
223  cluster->controldata.chkpnt_nxtxid = str2uint(p);
224  got_xid = true;
225  }
226  else if ((p = strstr(bufin, "Latest checkpoint's NextOID:")) != NULL)
227  {
228  p = strchr(p, ':');
229 
230  if (p == NULL || strlen(p) <= 1)
231  pg_fatal("%d: controldata retrieval problem\n", __LINE__);
232 
233  p++; /* remove ':' char */
234  cluster->controldata.chkpnt_nxtoid = str2uint(p);
235  got_oid = true;
236  }
237  else if ((p = strstr(bufin, "Latest checkpoint's NextMultiXactId:")) != NULL)
238  {
239  p = strchr(p, ':');
240 
241  if (p == NULL || strlen(p) <= 1)
242  pg_fatal("%d: controldata retrieval problem\n", __LINE__);
243 
244  p++; /* remove ':' char */
245  cluster->controldata.chkpnt_nxtmulti = str2uint(p);
246  got_multi = true;
247  }
248  else if ((p = strstr(bufin, "Latest checkpoint's oldestMultiXid:")) != NULL)
249  {
250  p = strchr(p, ':');
251 
252  if (p == NULL || strlen(p) <= 1)
253  pg_fatal("%d: controldata retrieval problem\n", __LINE__);
254 
255  p++; /* remove ':' char */
256  cluster->controldata.chkpnt_oldstMulti = str2uint(p);
257  got_oldestmulti = true;
258  }
259  else if ((p = strstr(bufin, "Latest checkpoint's NextMultiOffset:")) != NULL)
260  {
261  p = strchr(p, ':');
262 
263  if (p == NULL || strlen(p) <= 1)
264  pg_fatal("%d: controldata retrieval problem\n", __LINE__);
265 
266  p++; /* remove ':' char */
267  cluster->controldata.chkpnt_nxtmxoff = str2uint(p);
268  got_mxoff = true;
269  }
270  else if ((p = strstr(bufin, "First log segment after reset:")) != NULL)
271  {
272  /* Skip the colon and any whitespace after it */
273  p = strchr(p, ':');
274  if (p == NULL || strlen(p) <= 1)
275  pg_fatal("%d: controldata retrieval problem\n", __LINE__);
276  p = strpbrk(p, "01234567890ABCDEF");
277  if (p == NULL || strlen(p) <= 1)
278  pg_fatal("%d: controldata retrieval problem\n", __LINE__);
279 
280  /* Make sure it looks like a valid WAL file name */
281  if (strspn(p, "0123456789ABCDEF") != 24)
282  pg_fatal("%d: controldata retrieval problem\n", __LINE__);
283 
284  strlcpy(cluster->controldata.nextxlogfile, p, 25);
285  got_nextxlogfile = true;
286  }
287  else if ((p = strstr(bufin, "Float8 argument passing:")) != NULL)
288  {
289  p = strchr(p, ':');
290 
291  if (p == NULL || strlen(p) <= 1)
292  pg_fatal("%d: controldata retrieval problem\n", __LINE__);
293 
294  p++; /* remove ':' char */
295  /* used later for contrib check */
296  cluster->controldata.float8_pass_by_value = strstr(p, "by value") != NULL;
297  got_float8_pass_by_value = true;
298  }
299  else if ((p = strstr(bufin, "Maximum data alignment:")) != NULL)
300  {
301  p = strchr(p, ':');
302 
303  if (p == NULL || strlen(p) <= 1)
304  pg_fatal("%d: controldata retrieval problem\n", __LINE__);
305 
306  p++; /* remove ':' char */
307  cluster->controldata.align = str2uint(p);
308  got_align = true;
309  }
310  else if ((p = strstr(bufin, "Database block size:")) != NULL)
311  {
312  p = strchr(p, ':');
313 
314  if (p == NULL || strlen(p) <= 1)
315  pg_fatal("%d: controldata retrieval problem\n", __LINE__);
316 
317  p++; /* remove ':' char */
318  cluster->controldata.blocksz = str2uint(p);
319  got_blocksz = true;
320  }
321  else if ((p = strstr(bufin, "Blocks per segment of large relation:")) != NULL)
322  {
323  p = strchr(p, ':');
324 
325  if (p == NULL || strlen(p) <= 1)
326  pg_fatal("%d: controldata retrieval problem\n", __LINE__);
327 
328  p++; /* remove ':' char */
329  cluster->controldata.largesz = str2uint(p);
330  got_largesz = true;
331  }
332  else if ((p = strstr(bufin, "WAL block size:")) != NULL)
333  {
334  p = strchr(p, ':');
335 
336  if (p == NULL || strlen(p) <= 1)
337  pg_fatal("%d: controldata retrieval problem\n", __LINE__);
338 
339  p++; /* remove ':' char */
340  cluster->controldata.walsz = str2uint(p);
341  got_walsz = true;
342  }
343  else if ((p = strstr(bufin, "Bytes per WAL segment:")) != NULL)
344  {
345  p = strchr(p, ':');
346 
347  if (p == NULL || strlen(p) <= 1)
348  pg_fatal("%d: controldata retrieval problem\n", __LINE__);
349 
350  p++; /* remove ':' char */
351  cluster->controldata.walseg = str2uint(p);
352  got_walseg = true;
353  }
354  else if ((p = strstr(bufin, "Maximum length of identifiers:")) != NULL)
355  {
356  p = strchr(p, ':');
357 
358  if (p == NULL || strlen(p) <= 1)
359  pg_fatal("%d: controldata retrieval problem\n", __LINE__);
360 
361  p++; /* remove ':' char */
362  cluster->controldata.ident = str2uint(p);
363  got_ident = true;
364  }
365  else if ((p = strstr(bufin, "Maximum columns in an index:")) != NULL)
366  {
367  p = strchr(p, ':');
368 
369  if (p == NULL || strlen(p) <= 1)
370  pg_fatal("%d: controldata retrieval problem\n", __LINE__);
371 
372  p++; /* remove ':' char */
373  cluster->controldata.index = str2uint(p);
374  got_index = true;
375  }
376  else if ((p = strstr(bufin, "Maximum size of a TOAST chunk:")) != NULL)
377  {
378  p = strchr(p, ':');
379 
380  if (p == NULL || strlen(p) <= 1)
381  pg_fatal("%d: controldata retrieval problem\n", __LINE__);
382 
383  p++; /* remove ':' char */
384  cluster->controldata.toast = str2uint(p);
385  got_toast = true;
386  }
387  else if ((p = strstr(bufin, "Size of a large-object chunk:")) != NULL)
388  {
389  p = strchr(p, ':');
390 
391  if (p == NULL || strlen(p) <= 1)
392  pg_fatal("%d: controldata retrieval problem\n", __LINE__);
393 
394  p++; /* remove ':' char */
395  cluster->controldata.large_object = str2uint(p);
396  got_large_object = true;
397  }
398  else if ((p = strstr(bufin, "Date/time type storage:")) != NULL)
399  {
400  p = strchr(p, ':');
401 
402  if (p == NULL || strlen(p) <= 1)
403  pg_fatal("%d: controldata retrieval problem\n", __LINE__);
404 
405  p++; /* remove ':' char */
406  cluster->controldata.date_is_int = strstr(p, "64-bit integers") != NULL;
407  got_date_is_int = true;
408  }
409  else if ((p = strstr(bufin, "checksum")) != NULL)
410  {
411  p = strchr(p, ':');
412 
413  if (p == NULL || strlen(p) <= 1)
414  pg_fatal("%d: controldata retrieval problem\n", __LINE__);
415 
416  p++; /* remove ':' char */
417  /* used later for contrib check */
419  got_data_checksum_version = true;
420  }
421  }
422 
423  pclose(output);
424 
425  /*
426  * Restore environment variables
427  */
428  pg_putenv("LC_COLLATE", lc_collate);
429  pg_putenv("LC_CTYPE", lc_ctype);
430  pg_putenv("LC_MONETARY", lc_monetary);
431  pg_putenv("LC_NUMERIC", lc_numeric);
432  pg_putenv("LC_TIME", lc_time);
433  pg_putenv("LANG", lang);
434  pg_putenv("LANGUAGE", language);
435  pg_putenv("LC_ALL", lc_all);
436  pg_putenv("LC_MESSAGES", lc_messages);
437 
438  pg_free(lc_collate);
439  pg_free(lc_ctype);
440  pg_free(lc_monetary);
441  pg_free(lc_numeric);
442  pg_free(lc_time);
443  pg_free(lang);
444  pg_free(language);
445  pg_free(lc_all);
446  pg_free(lc_messages);
447 
448  /*
449  * Before 9.3, pg_resetwal reported the xlogid and segno of the first log
450  * file after reset as separate lines. Starting with 9.3, it reports the
451  * WAL file name. If the old cluster is older than 9.3, we construct the
452  * WAL file name from the xlogid and segno.
453  */
454  if (GET_MAJOR_VERSION(cluster->major_version) <= 902)
455  {
456  if (got_tli && got_log_id && got_log_seg)
457  {
458  snprintf(cluster->controldata.nextxlogfile, 25, "%08X%08X%08X",
459  tli, logid, segno);
460  got_nextxlogfile = true;
461  }
462  }
463 
464  /* verify that we got all the mandatory pg_control data */
465  if (!got_xid || !got_oid ||
466  !got_multi ||
467  (!got_oldestmulti &&
469  !got_mxoff || (!live_check && !got_nextxlogfile) ||
470  !got_float8_pass_by_value || !got_align || !got_blocksz ||
471  !got_largesz || !got_walsz || !got_walseg || !got_ident ||
472  !got_index || !got_toast ||
473  (!got_large_object &&
475  !got_date_is_int || !got_data_checksum_version)
476  {
478  "The %s cluster lacks some required control information:\n",
479  CLUSTER_NAME(cluster));
480 
481  if (!got_xid)
482  pg_log(PG_REPORT, " checkpoint next XID\n");
483 
484  if (!got_oid)
485  pg_log(PG_REPORT, " latest checkpoint next OID\n");
486 
487  if (!got_multi)
488  pg_log(PG_REPORT, " latest checkpoint next MultiXactId\n");
489 
490  if (!got_oldestmulti &&
492  pg_log(PG_REPORT, " latest checkpoint oldest MultiXactId\n");
493 
494  if (!got_mxoff)
495  pg_log(PG_REPORT, " latest checkpoint next MultiXactOffset\n");
496 
497  if (!live_check && !got_nextxlogfile)
498  pg_log(PG_REPORT, " first WAL segment after reset\n");
499 
500  if (!got_float8_pass_by_value)
501  pg_log(PG_REPORT, " float8 argument passing method\n");
502 
503  if (!got_align)
504  pg_log(PG_REPORT, " maximum alignment\n");
505 
506  if (!got_blocksz)
507  pg_log(PG_REPORT, " block size\n");
508 
509  if (!got_largesz)
510  pg_log(PG_REPORT, " large relation segment size\n");
511 
512  if (!got_walsz)
513  pg_log(PG_REPORT, " WAL block size\n");
514 
515  if (!got_walseg)
516  pg_log(PG_REPORT, " WAL segment size\n");
517 
518  if (!got_ident)
519  pg_log(PG_REPORT, " maximum identifier length\n");
520 
521  if (!got_index)
522  pg_log(PG_REPORT, " maximum number of indexed columns\n");
523 
524  if (!got_toast)
525  pg_log(PG_REPORT, " maximum TOAST chunk size\n");
526 
527  if (!got_large_object &&
529  pg_log(PG_REPORT, " large-object chunk size\n");
530 
531  if (!got_date_is_int)
532  pg_log(PG_REPORT, " dates/times are integers?\n");
533 
534  /* value added in Postgres 9.3 */
535  if (!got_data_checksum_version)
536  pg_log(PG_REPORT, " data checksum version\n");
537 
538  pg_fatal("Cannot continue without required control information, terminating\n");
539  }
540 }
bool date_is_int
Definition: pg_upgrade.h:225
static char * lc_monetary
Definition: initdb.c:126
uint32 major_version
Definition: pg_upgrade.h:272
unsigned int str2uint(const char *str)
Definition: util.c:241
static char * lc_collate
Definition: initdb.c:124
ControlData controldata
Definition: pg_upgrade.h:262
static void output(uint64 loop_count)
#define LARGE_OBJECT_SIZE_PG_CONTROL_VER
Definition: pg_upgrade.h:126
uint32 chkpnt_nxtoid
Definition: pg_upgrade.h:212
uint32 walsz
Definition: pg_upgrade.h:219
#define GET_MAJOR_VERSION(v)
Definition: pg_upgrade.h:29
char nextxlogfile[25]
Definition: pg_upgrade.h:209
int snprintf(char *str, size_t count, const char *fmt,...) pg_attribute_printf(3
void pg_fatal(const char *fmt,...)
Definition: logging.c:83
uint32 index
Definition: pg_upgrade.h:222
uint32 chkpnt_nxtmxoff
Definition: pg_upgrade.h:214
static char * lc_time
Definition: initdb.c:128
uint32 blocksz
Definition: pg_upgrade.h:217
uint32 chkpnt_nxtxid
Definition: pg_upgrade.h:210
static char * lc_messages
Definition: initdb.c:129
uint32 chkpnt_nxtepoch
Definition: pg_upgrade.h:211
#define MAXPGPATH
static char * lc_ctype
Definition: initdb.c:125
static char * lc_numeric
Definition: initdb.c:127
#define CLUSTER_NAME(cluster)
Definition: pg_upgrade.h:97
bool data_checksum_version
Definition: pg_upgrade.h:227
uint32 ident
Definition: pg_upgrade.h:221
char * pg_strdup(const char *in)
Definition: fe_memutils.c:85
unsigned int uint32
Definition: c.h:268
void pg_log(eLogType type, const char *fmt,...)
Definition: logging.c:69
uint32 align
Definition: pg_upgrade.h:216
uint32 chkpnt_oldstMulti
Definition: pg_upgrade.h:215
uint32 walseg
Definition: pg_upgrade.h:220
char * bindir
Definition: pg_upgrade.h:267
#define MAX_STRING
Definition: pg_upgrade.h:21
uint32 cat_ver
Definition: pg_upgrade.h:208
uint32 chkpnt_nxtmulti
Definition: pg_upgrade.h:213
uint32 largesz
Definition: pg_upgrade.h:218
uint32 bin_version
Definition: pg_upgrade.h:274
size_t strlcpy(char *dst, const char *src, size_t siz)
Definition: strlcpy.c:45
#define NULL
Definition: c.h:229
uint32 toast
Definition: pg_upgrade.h:223
uint32 large_object
Definition: pg_upgrade.h:224
void pg_free(void *ptr)
Definition: fe_memutils.c:105
#define MULTIXACT_FORMATCHANGE_CAT_VER
Definition: pg_upgrade.h:120
uint32 ctrl_ver
Definition: pg_upgrade.h:207
char * pgdata
Definition: pg_upgrade.h:264
const char * strerror(int errnum)
Definition: strerror.c:19
void pg_putenv(const char *var, const char *val)
Definition: util.c:254
bool float8_pass_by_value
Definition: pg_upgrade.h:226