diff options
| author | Bruce Momjian | 2014-09-11 00:22:10 +0000 |
|---|---|---|
| committer | Bruce Momjian | 2014-09-11 00:22:10 +0000 |
| commit | acc8e41681b4c07c60b2663e2e94bbff338189be (patch) | |
| tree | a3988567c0c156dcd1677560bab9ba2edf8a3a76 /contrib | |
| parent | e1598a15f4fb0f076a6034d3d3debb9776aff07a (diff) | |
pg_upgrade: compare control version, not catalog version
Also modify test for the possibility the large object value might not
exist in the old cluster.
Fix for commit e1598a15f4fb0f076a6034d3d3debb9776aff07a
Diffstat (limited to 'contrib')
| -rw-r--r-- | contrib/pg_upgrade/controldata.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/contrib/pg_upgrade/controldata.c b/contrib/pg_upgrade/controldata.c index d105a595557..676c77ea85e 100644 --- a/contrib/pg_upgrade/controldata.c +++ b/contrib/pg_upgrade/controldata.c @@ -488,7 +488,7 @@ get_control_data(ClusterInfo *cluster, bool live_check) !got_align || !got_blocksz || !got_largesz || !got_walsz || !got_walseg || !got_ident || !got_index || !got_toast || (!got_large_object && - cluster->controldata.cat_ver >= LARGE_OBJECT_SIZE_PG_CONTROL_VER) || + cluster->controldata.ctrl_ver >= LARGE_OBJECT_SIZE_PG_CONTROL_VER) || !got_date_is_int || !got_float8_pass_by_value || !got_data_checksum_version) { pg_log(PG_REPORT, @@ -542,7 +542,7 @@ get_control_data(ClusterInfo *cluster, bool live_check) pg_log(PG_REPORT, " maximum TOAST chunk size\n"); if (!got_large_object && - cluster->controldata.cat_ver >= LARGE_OBJECT_SIZE_PG_CONTROL_VER) + cluster->controldata.ctrl_ver >= LARGE_OBJECT_SIZE_PG_CONTROL_VER) pg_log(PG_REPORT, " large-object chunk size\n"); if (!got_date_is_int) @@ -594,7 +594,9 @@ check_control_data(ControlData *oldctrl, if (oldctrl->toast == 0 || oldctrl->toast != newctrl->toast) pg_fatal("old and new pg_controldata maximum TOAST chunk sizes are invalid or do not match\n"); - if (oldctrl->large_object == 0 || oldctrl->large_object != newctrl->large_object) + /* large_object added in 9.5, so it might not exist in the old cluster */ + if (oldctrl->large_object != 0 && + oldctrl->large_object != newctrl->large_object) pg_fatal("old and new pg_controldata large-object chunk sizes are invalid or do not match\n"); if (oldctrl->date_is_int != newctrl->date_is_int) |
