Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
e1598a15
Commit
e1598a15
authored
Sep 10, 2014
by
Bruce Momjian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pg_upgrade: check for large object size compatibility
parent
36ad1a87
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
0 deletions
+28
-0
contrib/pg_upgrade/controldata.c
contrib/pg_upgrade/controldata.c
+21
-0
contrib/pg_upgrade/pg_upgrade.h
contrib/pg_upgrade/pg_upgrade.h
+7
-0
No files found.
contrib/pg_upgrade/controldata.c
View file @
e1598a15
...
@@ -54,6 +54,7 @@ get_control_data(ClusterInfo *cluster, bool live_check)
...
@@ -54,6 +54,7 @@ get_control_data(ClusterInfo *cluster, bool live_check)
bool
got_ident
=
false
;
bool
got_ident
=
false
;
bool
got_index
=
false
;
bool
got_index
=
false
;
bool
got_toast
=
false
;
bool
got_toast
=
false
;
bool
got_large_object
=
false
;
bool
got_date_is_int
=
false
;
bool
got_date_is_int
=
false
;
bool
got_float8_pass_by_value
=
false
;
bool
got_float8_pass_by_value
=
false
;
bool
got_data_checksum_version
=
false
;
bool
got_data_checksum_version
=
false
;
...
@@ -357,6 +358,17 @@ get_control_data(ClusterInfo *cluster, bool live_check)
...
@@ -357,6 +358,17 @@ get_control_data(ClusterInfo *cluster, bool live_check)
cluster
->
controldata
.
toast
=
str2uint
(
p
);
cluster
->
controldata
.
toast
=
str2uint
(
p
);
got_toast
=
true
;
got_toast
=
true
;
}
}
else
if
((
p
=
strstr
(
bufin
,
"Size of a large-object chunk:"
))
!=
NULL
)
{
p
=
strchr
(
p
,
':'
);
if
(
p
==
NULL
||
strlen
(
p
)
<=
1
)
pg_fatal
(
"%d: controldata retrieval problem
\n
"
,
__LINE__
);
p
++
;
/* removing ':' char */
cluster
->
controldata
.
large_object
=
str2uint
(
p
);
got_large_object
=
true
;
}
else
if
((
p
=
strstr
(
bufin
,
"Date/time type storage:"
))
!=
NULL
)
else
if
((
p
=
strstr
(
bufin
,
"Date/time type storage:"
))
!=
NULL
)
{
{
p
=
strchr
(
p
,
':'
);
p
=
strchr
(
p
,
':'
);
...
@@ -475,6 +487,8 @@ get_control_data(ClusterInfo *cluster, bool live_check)
...
@@ -475,6 +487,8 @@ get_control_data(ClusterInfo *cluster, bool live_check)
!
got_tli
||
!
got_tli
||
!
got_align
||
!
got_blocksz
||
!
got_largesz
||
!
got_walsz
||
!
got_align
||
!
got_blocksz
||
!
got_largesz
||
!
got_walsz
||
!
got_walseg
||
!
got_ident
||
!
got_index
||
!
got_toast
||
!
got_walseg
||
!
got_ident
||
!
got_index
||
!
got_toast
||
(
!
got_large_object
&&
cluster
->
controldata
.
cat_ver
>=
LARGE_OBJECT_SIZE_PG_CONTROL_VER
)
||
!
got_date_is_int
||
!
got_float8_pass_by_value
||
!
got_data_checksum_version
)
!
got_date_is_int
||
!
got_float8_pass_by_value
||
!
got_data_checksum_version
)
{
{
pg_log
(
PG_REPORT
,
pg_log
(
PG_REPORT
,
...
@@ -527,6 +541,10 @@ get_control_data(ClusterInfo *cluster, bool live_check)
...
@@ -527,6 +541,10 @@ get_control_data(ClusterInfo *cluster, bool live_check)
if
(
!
got_toast
)
if
(
!
got_toast
)
pg_log
(
PG_REPORT
,
" maximum TOAST chunk size
\n
"
);
pg_log
(
PG_REPORT
,
" maximum TOAST chunk size
\n
"
);
if
(
!
got_large_object
&&
cluster
->
controldata
.
cat_ver
>=
LARGE_OBJECT_SIZE_PG_CONTROL_VER
)
pg_log
(
PG_REPORT
,
" large-object chunk size
\n
"
);
if
(
!
got_date_is_int
)
if
(
!
got_date_is_int
)
pg_log
(
PG_REPORT
,
" dates/times are integers?
\n
"
);
pg_log
(
PG_REPORT
,
" dates/times are integers?
\n
"
);
...
@@ -576,6 +594,9 @@ check_control_data(ControlData *oldctrl,
...
@@ -576,6 +594,9 @@ check_control_data(ControlData *oldctrl,
if
(
oldctrl
->
toast
==
0
||
oldctrl
->
toast
!=
newctrl
->
toast
)
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
"
);
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
)
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
)
if
(
oldctrl
->
date_is_int
!=
newctrl
->
date_is_int
)
pg_fatal
(
"old and new pg_controldata date/time storage types do not match
\n
"
);
pg_fatal
(
"old and new pg_controldata date/time storage types do not match
\n
"
);
...
...
contrib/pg_upgrade/pg_upgrade.h
View file @
e1598a15
...
@@ -115,6 +115,12 @@ extern char *output_files[];
...
@@ -115,6 +115,12 @@ extern char *output_files[];
*/
*/
#define MULTIXACT_FORMATCHANGE_CAT_VER 201301231
#define MULTIXACT_FORMATCHANGE_CAT_VER 201301231
/*
* large object chunk size added to pg_controldata,
* commit 5f93c37805e7485488480916b4585e098d3cc883
*/
#define LARGE_OBJECT_SIZE_PG_CONTROL_VER 942
/*
/*
* Each relation is represented by a relinfo structure.
* Each relation is represented by a relinfo structure.
*/
*/
...
@@ -203,6 +209,7 @@ typedef struct
...
@@ -203,6 +209,7 @@ typedef struct
uint32
ident
;
uint32
ident
;
uint32
index
;
uint32
index
;
uint32
toast
;
uint32
toast
;
uint32
large_object
;
bool
date_is_int
;
bool
date_is_int
;
bool
float8_pass_by_value
;
bool
float8_pass_by_value
;
bool
data_checksum_version
;
bool
data_checksum_version
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment