Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commite1598a1

Browse files
committed
pg_upgrade: check for large object size compatibility
1 parent36ad1a8 commite1598a1

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

‎contrib/pg_upgrade/controldata.c

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ get_control_data(ClusterInfo *cluster, bool live_check)
5454
boolgot_ident= false;
5555
boolgot_index= false;
5656
boolgot_toast= false;
57+
boolgot_large_object= false;
5758
boolgot_date_is_int= false;
5859
boolgot_float8_pass_by_value= false;
5960
boolgot_data_checksum_version= false;
@@ -357,6 +358,17 @@ get_control_data(ClusterInfo *cluster, bool live_check)
357358
cluster->controldata.toast=str2uint(p);
358359
got_toast= true;
359360
}
361+
elseif ((p=strstr(bufin,"Size of a large-object chunk:"))!=NULL)
362+
{
363+
p=strchr(p,':');
364+
365+
if (p==NULL||strlen(p) <=1)
366+
pg_fatal("%d: controldata retrieval problem\n",__LINE__);
367+
368+
p++;/* removing ':' char */
369+
cluster->controldata.large_object=str2uint(p);
370+
got_large_object= true;
371+
}
360372
elseif ((p=strstr(bufin,"Date/time type storage:"))!=NULL)
361373
{
362374
p=strchr(p,':');
@@ -475,6 +487,8 @@ get_control_data(ClusterInfo *cluster, bool live_check)
475487
!got_tli||
476488
!got_align|| !got_blocksz|| !got_largesz|| !got_walsz||
477489
!got_walseg|| !got_ident|| !got_index|| !got_toast||
490+
(!got_large_object&&
491+
cluster->controldata.cat_ver >=LARGE_OBJECT_SIZE_PG_CONTROL_VER)||
478492
!got_date_is_int|| !got_float8_pass_by_value|| !got_data_checksum_version)
479493
{
480494
pg_log(PG_REPORT,
@@ -527,6 +541,10 @@ get_control_data(ClusterInfo *cluster, bool live_check)
527541
if (!got_toast)
528542
pg_log(PG_REPORT," maximum TOAST chunk size\n");
529543

544+
if (!got_large_object&&
545+
cluster->controldata.cat_ver >=LARGE_OBJECT_SIZE_PG_CONTROL_VER)
546+
pg_log(PG_REPORT," large-object chunk size\n");
547+
530548
if (!got_date_is_int)
531549
pg_log(PG_REPORT," dates/times are integers?\n");
532550

@@ -576,6 +594,9 @@ check_control_data(ControlData *oldctrl,
576594
if (oldctrl->toast==0||oldctrl->toast!=newctrl->toast)
577595
pg_fatal("old and new pg_controldata maximum TOAST chunk sizes are invalid or do not match\n");
578596

597+
if (oldctrl->large_object==0||oldctrl->large_object!=newctrl->large_object)
598+
pg_fatal("old and new pg_controldata large-object chunk sizes are invalid or do not match\n");
599+
579600
if (oldctrl->date_is_int!=newctrl->date_is_int)
580601
pg_fatal("old and new pg_controldata date/time storage types do not match\n");
581602

‎contrib/pg_upgrade/pg_upgrade.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,12 @@ extern char *output_files[];
115115
*/
116116
#defineMULTIXACT_FORMATCHANGE_CAT_VER 201301231
117117

118+
/*
119+
* large object chunk size added to pg_controldata,
120+
* commit 5f93c37805e7485488480916b4585e098d3cc883
121+
*/
122+
#defineLARGE_OBJECT_SIZE_PG_CONTROL_VER 942
123+
118124
/*
119125
* Each relation is represented by a relinfo structure.
120126
*/
@@ -203,6 +209,7 @@ typedef struct
203209
uint32ident;
204210
uint32index;
205211
uint32toast;
212+
uint32large_object;
206213
booldate_is_int;
207214
boolfloat8_pass_by_value;
208215
booldata_checksum_version;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp