pg_log(ctx, PG_FATAL, "%d: pg_resetxlog problem\n", __LINE__);
p++; /* removing ':' char */
- cluster->controldata.ctrl_ver = (uint32) atol(p);
+ cluster->controldata.ctrl_ver = str2uint(p);
}
else if ((p = strstr(bufin, "Catalog version number:")) != NULL)
{
pg_log(ctx, PG_FATAL, "%d: controldata retrieval problem\n", __LINE__);
p++; /* removing ':' char */
- cluster->controldata.cat_ver = (uint32) atol(p);
+ cluster->controldata.cat_ver = str2uint(p);
}
else if ((p = strstr(bufin, "First log file ID after reset:")) != NULL)
{
pg_log(ctx, PG_FATAL, "%d: controldata retrieval problem\n", __LINE__);
p++; /* removing ':' char */
- cluster->controldata.logid = (uint32) atol(p);
+ cluster->controldata.logid = str2uint(p);
got_log_id = true;
}
else if ((p = strstr(bufin, "First log file segment after reset:")) != NULL)
pg_log(ctx, PG_FATAL, "%d: controldata retrieval problem\n", __LINE__);
p++; /* removing ':' char */
- cluster->controldata.nxtlogseg = (uint32) atol(p);
+ cluster->controldata.nxtlogseg = str2uint(p);
got_log_seg = true;
}
else if ((p = strstr(bufin, "Latest checkpoint's TimeLineID:")) != NULL)
pg_log(ctx, PG_FATAL, "%d: controldata retrieval problem\n", __LINE__);
p++; /* removing ':' char */
- cluster->controldata.chkpnt_tli = (uint32) atol(p);
+ cluster->controldata.chkpnt_tli = str2uint(p);
got_tli = true;
}
else if ((p = strstr(bufin, "Latest checkpoint's NextXID:")) != NULL)
pg_log(ctx, PG_FATAL, "%d: controldata retrieval problem\n", __LINE__);
op++; /* removing ':' char */
- cluster->controldata.chkpnt_nxtxid = (uint32) atol(op);
+ cluster->controldata.chkpnt_nxtxid = str2uint(op);
got_xid = true;
}
else if ((p = strstr(bufin, "Latest checkpoint's NextOID:")) != NULL)
pg_log(ctx, PG_FATAL, "%d: controldata retrieval problem\n", __LINE__);
p++; /* removing ':' char */
- cluster->controldata.chkpnt_nxtoid = (uint32) atol(p);
+ cluster->controldata.chkpnt_nxtoid = str2uint(p);
got_oid = true;
}
else if ((p = strstr(bufin, "Maximum data alignment:")) != NULL)
pg_log(ctx, PG_FATAL, "%d: controldata retrieval problem\n", __LINE__);
p++; /* removing ':' char */
- cluster->controldata.align = (uint32) atol(p);
+ cluster->controldata.align = str2uint(p);
got_align = true;
}
else if ((p = strstr(bufin, "Database block size:")) != NULL)
pg_log(ctx, PG_FATAL, "%d: controldata retrieval problem\n", __LINE__);
p++; /* removing ':' char */
- cluster->controldata.blocksz = (uint32) atol(p);
+ cluster->controldata.blocksz = str2uint(p);
got_blocksz = true;
}
else if ((p = strstr(bufin, "Blocks per segment of large relation:")) != NULL)
pg_log(ctx, PG_FATAL, "%d: controldata retrieval problem\n", __LINE__);
p++; /* removing ':' char */
- cluster->controldata.largesz = (uint32) atol(p);
+ cluster->controldata.largesz = str2uint(p);
got_largesz = true;
}
else if ((p = strstr(bufin, "WAL block size:")) != NULL)
pg_log(ctx, PG_FATAL, "%d: controldata retrieval problem\n", __LINE__);
p++; /* removing ':' char */
- cluster->controldata.walsz = (uint32) atol(p);
+ cluster->controldata.walsz = str2uint(p);
got_walsz = true;
}
else if ((p = strstr(bufin, "Bytes per WAL segment:")) != NULL)
pg_log(ctx, PG_FATAL, "%d: controldata retrieval problem\n", __LINE__);
p++; /* removing ':' char */
- cluster->controldata.walseg = (uint32) atol(p);
+ cluster->controldata.walseg = str2uint(p);
got_walseg = true;
}
else if ((p = strstr(bufin, "Maximum length of identifiers:")) != NULL)
pg_log(ctx, PG_FATAL, "%d: controldata retrieval problem\n", __LINE__);
p++; /* removing ':' char */
- cluster->controldata.ident = (uint32) atol(p);
+ cluster->controldata.ident = str2uint(p);
got_ident = true;
}
else if ((p = strstr(bufin, "Maximum columns in an index:")) != NULL)
pg_log(ctx, PG_FATAL, "%d: controldata retrieval problem\n", __LINE__);
p++; /* removing ':' char */
- cluster->controldata.index = (uint32) atol(p);
+ cluster->controldata.index = str2uint(p);
got_index = true;
}
else if ((p = strstr(bufin, "Maximum size of a TOAST chunk:")) != NULL)
pg_log(ctx, PG_FATAL, "%d: controldata retrieval problem\n", __LINE__);
p++; /* removing ':' char */
- cluster->controldata.toast = (uint32) atol(p);
+ cluster->controldata.toast = str2uint(p);
got_toast = true;
}
else if ((p = strstr(bufin, "Date/time type storage:")) != NULL)
for (tupnum = 0; tupnum < ntups; tupnum++)
{
- dbinfos[tupnum].db_oid = atol(PQgetvalue(res, tupnum, i_oid));
+ dbinfos[tupnum].db_oid = str2uint(PQgetvalue(res, tupnum, i_oid));
snprintf(dbinfos[tupnum].db_name, sizeof(dbinfos[tupnum].db_name), "%s",
PQgetvalue(res, tupnum, i_datname));
RelInfo *curr = &relinfos[num_rels++];
const char *tblspace;
- curr->reloid = atol(PQgetvalue(res, relnum, i_oid));
+ curr->reloid = str2uint(PQgetvalue(res, relnum, i_oid));
nspname = PQgetvalue(res, relnum, i_nspname);
strlcpy(curr->nspname, nspname, sizeof(curr->nspname));
relname = PQgetvalue(res, relnum, i_relname);
strlcpy(curr->relname, relname, sizeof(curr->relname));
- curr->relfilenode = atol(PQgetvalue(res, relnum, i_relfilenode));
- curr->toastrelid = atol(PQgetvalue(res, relnum, i_reltoastrelid));
+ curr->relfilenode = str2uint(PQgetvalue(res, relnum, i_relfilenode));
+ curr->toastrelid = str2uint(PQgetvalue(res, relnum, i_reltoastrelid));
tblspace = PQgetvalue(res, relnum, i_spclocation);
/* if no table tablespace, use the database tablespace */