mirror of
https://github.com/postgres/postgres.git
synced 2026-01-26 09:41:40 +03:00
Add const to read only TableInfo pointers in pg_dump
Functions that dump table data receive their parameters through const void * but were casting away const. Add const qualifiers to functions that only read the table information. Author: Bertrand Drouvot <bertranddrouvot.pg@gmail.com> Discussion: https://postgr.es/m/aUQHy/MmWq7c97wK%40ip-10-97-1-34.eu-west-3.compute.internal
This commit is contained in:
@@ -2380,8 +2380,8 @@ selectDumpableObject(DumpableObject *dobj, Archive *fout)
|
||||
static int
|
||||
dumpTableData_copy(Archive *fout, const void *dcontext)
|
||||
{
|
||||
TableDataInfo *tdinfo = (TableDataInfo *) dcontext;
|
||||
TableInfo *tbinfo = tdinfo->tdtable;
|
||||
const TableDataInfo *tdinfo = dcontext;
|
||||
const TableInfo *tbinfo = tdinfo->tdtable;
|
||||
const char *classname = tbinfo->dobj.name;
|
||||
PQExpBuffer q = createPQExpBuffer();
|
||||
|
||||
@@ -2548,8 +2548,8 @@ dumpTableData_copy(Archive *fout, const void *dcontext)
|
||||
static int
|
||||
dumpTableData_insert(Archive *fout, const void *dcontext)
|
||||
{
|
||||
TableDataInfo *tdinfo = (TableDataInfo *) dcontext;
|
||||
TableInfo *tbinfo = tdinfo->tdtable;
|
||||
const TableDataInfo *tdinfo = dcontext;
|
||||
const TableInfo *tbinfo = tdinfo->tdtable;
|
||||
DumpOptions *dopt = fout->dopt;
|
||||
PQExpBuffer q = createPQExpBuffer();
|
||||
PQExpBuffer insertStmt = NULL;
|
||||
@@ -2619,7 +2619,7 @@ dumpTableData_insert(Archive *fout, const void *dcontext)
|
||||
*/
|
||||
if (insertStmt == NULL)
|
||||
{
|
||||
TableInfo *targettab;
|
||||
const TableInfo *targettab;
|
||||
|
||||
insertStmt = createPQExpBuffer();
|
||||
|
||||
@@ -2871,7 +2871,7 @@ static void
|
||||
dumpTableData(Archive *fout, const TableDataInfo *tdinfo)
|
||||
{
|
||||
DumpOptions *dopt = fout->dopt;
|
||||
TableInfo *tbinfo = tdinfo->tdtable;
|
||||
const TableInfo *tbinfo = tdinfo->tdtable;
|
||||
PQExpBuffer copyBuf = createPQExpBuffer();
|
||||
PQExpBuffer clistBuf = createPQExpBuffer();
|
||||
DataDumperPtr dumpFn;
|
||||
@@ -2892,7 +2892,7 @@ dumpTableData(Archive *fout, const TableDataInfo *tdinfo)
|
||||
(dopt->load_via_partition_root ||
|
||||
forcePartitionRootLoad(tbinfo)))
|
||||
{
|
||||
TableInfo *parentTbinfo;
|
||||
const TableInfo *parentTbinfo;
|
||||
char *sanitized;
|
||||
|
||||
parentTbinfo = getRootTableInfo(tbinfo);
|
||||
|
||||
Reference in New Issue
Block a user