@@ -155,7 +155,7 @@ get_control_data(migratorContext *ctx, ClusterInfo *cluster, bool live_check)
155155pg_log (ctx ,PG_FATAL ,"%d: pg_resetxlog problem\n" ,__LINE__ );
156156
157157p ++ ;/* removing ':' char */
158- cluster -> controldata .ctrl_ver = ( uint32 ) atol (p );
158+ cluster -> controldata .ctrl_ver = str2uint (p );
159159}
160160else if ((p = strstr (bufin ,"Catalog version number:" ))!= NULL )
161161{
@@ -165,7 +165,7 @@ get_control_data(migratorContext *ctx, ClusterInfo *cluster, bool live_check)
165165pg_log (ctx ,PG_FATAL ,"%d: controldata retrieval problem\n" ,__LINE__ );
166166
167167p ++ ;/* removing ':' char */
168- cluster -> controldata .cat_ver = ( uint32 ) atol (p );
168+ cluster -> controldata .cat_ver = str2uint (p );
169169}
170170else if ((p = strstr (bufin ,"First log file ID after reset:" ))!= NULL )
171171{
@@ -175,7 +175,7 @@ get_control_data(migratorContext *ctx, ClusterInfo *cluster, bool live_check)
175175pg_log (ctx ,PG_FATAL ,"%d: controldata retrieval problem\n" ,__LINE__ );
176176
177177p ++ ;/* removing ':' char */
178- cluster -> controldata .logid = ( uint32 ) atol (p );
178+ cluster -> controldata .logid = str2uint (p );
179179got_log_id = true;
180180}
181181else if ((p = strstr (bufin ,"First log file segment after reset:" ))!= NULL )
@@ -186,7 +186,7 @@ get_control_data(migratorContext *ctx, ClusterInfo *cluster, bool live_check)
186186pg_log (ctx ,PG_FATAL ,"%d: controldata retrieval problem\n" ,__LINE__ );
187187
188188p ++ ;/* removing ':' char */
189- cluster -> controldata .nxtlogseg = ( uint32 ) atol (p );
189+ cluster -> controldata .nxtlogseg = str2uint (p );
190190got_log_seg = true;
191191}
192192else if ((p = strstr (bufin ,"Latest checkpoint's TimeLineID:" ))!= NULL )
@@ -197,7 +197,7 @@ get_control_data(migratorContext *ctx, ClusterInfo *cluster, bool live_check)
197197pg_log (ctx ,PG_FATAL ,"%d: controldata retrieval problem\n" ,__LINE__ );
198198
199199p ++ ;/* removing ':' char */
200- cluster -> controldata .chkpnt_tli = ( uint32 ) atol (p );
200+ cluster -> controldata .chkpnt_tli = str2uint (p );
201201got_tli = true;
202202}
203203else if ((p = strstr (bufin ,"Latest checkpoint's NextXID:" ))!= NULL )
@@ -211,7 +211,7 @@ get_control_data(migratorContext *ctx, ClusterInfo *cluster, bool live_check)
211211pg_log (ctx ,PG_FATAL ,"%d: controldata retrieval problem\n" ,__LINE__ );
212212
213213op ++ ;/* removing ':' char */
214- cluster -> controldata .chkpnt_nxtxid = ( uint32 ) atol (op );
214+ cluster -> controldata .chkpnt_nxtxid = str2uint (op );
215215got_xid = true;
216216}
217217else if ((p = strstr (bufin ,"Latest checkpoint's NextOID:" ))!= NULL )
@@ -222,7 +222,7 @@ get_control_data(migratorContext *ctx, ClusterInfo *cluster, bool live_check)
222222pg_log (ctx ,PG_FATAL ,"%d: controldata retrieval problem\n" ,__LINE__ );
223223
224224p ++ ;/* removing ':' char */
225- cluster -> controldata .chkpnt_nxtoid = ( uint32 ) atol (p );
225+ cluster -> controldata .chkpnt_nxtoid = str2uint (p );
226226got_oid = true;
227227}
228228else if ((p = strstr (bufin ,"Maximum data alignment:" ))!= NULL )
@@ -233,7 +233,7 @@ get_control_data(migratorContext *ctx, ClusterInfo *cluster, bool live_check)
233233pg_log (ctx ,PG_FATAL ,"%d: controldata retrieval problem\n" ,__LINE__ );
234234
235235p ++ ;/* removing ':' char */
236- cluster -> controldata .align = ( uint32 ) atol (p );
236+ cluster -> controldata .align = str2uint (p );
237237got_align = true;
238238}
239239else if ((p = strstr (bufin ,"Database block size:" ))!= NULL )
@@ -244,7 +244,7 @@ get_control_data(migratorContext *ctx, ClusterInfo *cluster, bool live_check)
244244pg_log (ctx ,PG_FATAL ,"%d: controldata retrieval problem\n" ,__LINE__ );
245245
246246p ++ ;/* removing ':' char */
247- cluster -> controldata .blocksz = ( uint32 ) atol (p );
247+ cluster -> controldata .blocksz = str2uint (p );
248248got_blocksz = true;
249249}
250250else if ((p = strstr (bufin ,"Blocks per segment of large relation:" ))!= NULL )
@@ -255,7 +255,7 @@ get_control_data(migratorContext *ctx, ClusterInfo *cluster, bool live_check)
255255pg_log (ctx ,PG_FATAL ,"%d: controldata retrieval problem\n" ,__LINE__ );
256256
257257p ++ ;/* removing ':' char */
258- cluster -> controldata .largesz = ( uint32 ) atol (p );
258+ cluster -> controldata .largesz = str2uint (p );
259259got_largesz = true;
260260}
261261else if ((p = strstr (bufin ,"WAL block size:" ))!= NULL )
@@ -266,7 +266,7 @@ get_control_data(migratorContext *ctx, ClusterInfo *cluster, bool live_check)
266266pg_log (ctx ,PG_FATAL ,"%d: controldata retrieval problem\n" ,__LINE__ );
267267
268268p ++ ;/* removing ':' char */
269- cluster -> controldata .walsz = ( uint32 ) atol (p );
269+ cluster -> controldata .walsz = str2uint (p );
270270got_walsz = true;
271271}
272272else if ((p = strstr (bufin ,"Bytes per WAL segment:" ))!= NULL )
@@ -277,7 +277,7 @@ get_control_data(migratorContext *ctx, ClusterInfo *cluster, bool live_check)
277277pg_log (ctx ,PG_FATAL ,"%d: controldata retrieval problem\n" ,__LINE__ );
278278
279279p ++ ;/* removing ':' char */
280- cluster -> controldata .walseg = ( uint32 ) atol (p );
280+ cluster -> controldata .walseg = str2uint (p );
281281got_walseg = true;
282282}
283283else if ((p = strstr (bufin ,"Maximum length of identifiers:" ))!= NULL )
@@ -288,7 +288,7 @@ get_control_data(migratorContext *ctx, ClusterInfo *cluster, bool live_check)
288288pg_log (ctx ,PG_FATAL ,"%d: controldata retrieval problem\n" ,__LINE__ );
289289
290290p ++ ;/* removing ':' char */
291- cluster -> controldata .ident = ( uint32 ) atol (p );
291+ cluster -> controldata .ident = str2uint (p );
292292got_ident = true;
293293}
294294else if ((p = strstr (bufin ,"Maximum columns in an index:" ))!= NULL )
@@ -299,7 +299,7 @@ get_control_data(migratorContext *ctx, ClusterInfo *cluster, bool live_check)
299299pg_log (ctx ,PG_FATAL ,"%d: controldata retrieval problem\n" ,__LINE__ );
300300
301301p ++ ;/* removing ':' char */
302- cluster -> controldata .index = ( uint32 ) atol (p );
302+ cluster -> controldata .index = str2uint (p );
303303got_index = true;
304304}
305305else if ((p = strstr (bufin ,"Maximum size of a TOAST chunk:" ))!= NULL )
@@ -310,7 +310,7 @@ get_control_data(migratorContext *ctx, ClusterInfo *cluster, bool live_check)
310310pg_log (ctx ,PG_FATAL ,"%d: controldata retrieval problem\n" ,__LINE__ );
311311
312312p ++ ;/* removing ':' char */
313- cluster -> controldata .toast = ( uint32 ) atol (p );
313+ cluster -> controldata .toast = str2uint (p );
314314got_toast = true;
315315}
316316else if ((p = strstr (bufin ,"Date/time type storage:" ))!= NULL )