Commit 8354e7b2 authored by Peter Eisentraut's avatar Peter Eisentraut

Remove unused parameters

Remove various unused parameters in pg_dump code.  These have all
become unused over time or were never used.

Discussion: https://www.postgresql.org/message-id/flat/511bb100-f829-ba21-2f10-9f952ec06ead%402ndquadrant.com
parent ff28809f
...@@ -685,7 +685,7 @@ AddAcl(PQExpBuffer aclbuf, const char *keyword, const char *subname) ...@@ -685,7 +685,7 @@ AddAcl(PQExpBuffer aclbuf, const char *keyword, const char *subname)
* keep this file free of assumptions about how to deal with SQL errors.) * keep this file free of assumptions about how to deal with SQL errors.)
*/ */
void void
buildShSecLabelQuery(PGconn *conn, const char *catalog_name, Oid objectId, buildShSecLabelQuery(const char *catalog_name, Oid objectId,
PQExpBuffer sql) PQExpBuffer sql)
{ {
appendPQExpBuffer(sql, appendPQExpBuffer(sql,
......
...@@ -46,7 +46,7 @@ extern bool buildDefaultACLCommands(const char *type, const char *nspname, ...@@ -46,7 +46,7 @@ extern bool buildDefaultACLCommands(const char *type, const char *nspname,
const char *owner, const char *owner,
int remoteVersion, int remoteVersion,
PQExpBuffer sql); PQExpBuffer sql);
extern void buildShSecLabelQuery(PGconn *conn, const char *catalog_name, extern void buildShSecLabelQuery(const char *catalog_name,
Oid objectId, PQExpBuffer sql); Oid objectId, PQExpBuffer sql);
extern void emitShSecLabels(PGconn *conn, PGresult *res, extern void emitShSecLabels(PGconn *conn, PGresult *res,
PQExpBuffer buffer, const char *objtype, const char *objname); PQExpBuffer buffer, const char *objtype, const char *objname);
......
...@@ -70,8 +70,7 @@ typedef struct _parallelReadyList ...@@ -70,8 +70,7 @@ typedef struct _parallelReadyList
static ArchiveHandle *_allocAH(const char *FileSpec, const ArchiveFormat fmt, static ArchiveHandle *_allocAH(const char *FileSpec, const ArchiveFormat fmt,
const int compression, bool dosync, ArchiveMode mode, const int compression, bool dosync, ArchiveMode mode,
SetupWorkerPtrType setupWorkerPtr); SetupWorkerPtrType setupWorkerPtr);
static void _getObjectDescription(PQExpBuffer buf, TocEntry *te, static void _getObjectDescription(PQExpBuffer buf, TocEntry *te);
ArchiveHandle *AH);
static void _printTocEntry(ArchiveHandle *AH, TocEntry *te, bool isData); static void _printTocEntry(ArchiveHandle *AH, TocEntry *te, bool isData);
static char *sanitize_line(const char *str, bool want_hyphen); static char *sanitize_line(const char *str, bool want_hyphen);
static void _doSetFixedOutputState(ArchiveHandle *AH); static void _doSetFixedOutputState(ArchiveHandle *AH);
...@@ -91,7 +90,7 @@ static bool _tocEntryIsACL(TocEntry *te); ...@@ -91,7 +90,7 @@ static bool _tocEntryIsACL(TocEntry *te);
static void _disableTriggersIfNecessary(ArchiveHandle *AH, TocEntry *te); static void _disableTriggersIfNecessary(ArchiveHandle *AH, TocEntry *te);
static void _enableTriggersIfNecessary(ArchiveHandle *AH, TocEntry *te); static void _enableTriggersIfNecessary(ArchiveHandle *AH, TocEntry *te);
static void buildTocEntryArrays(ArchiveHandle *AH); static void buildTocEntryArrays(ArchiveHandle *AH);
static void _moveBefore(ArchiveHandle *AH, TocEntry *pos, TocEntry *te); static void _moveBefore(TocEntry *pos, TocEntry *te);
static int _discoverArchiveFormat(ArchiveHandle *AH); static int _discoverArchiveFormat(ArchiveHandle *AH);
static int RestoringToDB(ArchiveHandle *AH); static int RestoringToDB(ArchiveHandle *AH);
...@@ -121,8 +120,7 @@ static int TocEntrySizeCompare(const void *p1, const void *p2); ...@@ -121,8 +120,7 @@ static int TocEntrySizeCompare(const void *p1, const void *p2);
static void move_to_ready_list(TocEntry *pending_list, static void move_to_ready_list(TocEntry *pending_list,
ParallelReadyList *ready_list, ParallelReadyList *ready_list,
RestorePass pass); RestorePass pass);
static TocEntry *pop_next_work_item(ArchiveHandle *AH, static TocEntry *pop_next_work_item(ParallelReadyList *ready_list,
ParallelReadyList *ready_list,
ParallelState *pstate); ParallelState *pstate);
static void mark_dump_job_done(ArchiveHandle *AH, static void mark_dump_job_done(ArchiveHandle *AH,
TocEntry *te, TocEntry *te,
...@@ -1442,7 +1440,7 @@ SortTocFromFile(Archive *AHX) ...@@ -1442,7 +1440,7 @@ SortTocFromFile(Archive *AHX)
* side-effects on the order in which restorable items actually get * side-effects on the order in which restorable items actually get
* restored. * restored.
*/ */
_moveBefore(AH, AH->toc, te); _moveBefore(AH->toc, te);
} }
if (fclose(fh) != 0) if (fclose(fh) != 0)
...@@ -1804,7 +1802,7 @@ _moveAfter(ArchiveHandle *AH, TocEntry *pos, TocEntry *te) ...@@ -1804,7 +1802,7 @@ _moveAfter(ArchiveHandle *AH, TocEntry *pos, TocEntry *te)
#endif #endif
static void static void
_moveBefore(ArchiveHandle *AH, TocEntry *pos, TocEntry *te) _moveBefore(TocEntry *pos, TocEntry *te)
{ {
/* Unlink te from list */ /* Unlink te from list */
te->prev->next = te->next; te->prev->next = te->next;
...@@ -3465,7 +3463,7 @@ _selectTableAccessMethod(ArchiveHandle *AH, const char *tableam) ...@@ -3465,7 +3463,7 @@ _selectTableAccessMethod(ArchiveHandle *AH, const char *tableam)
* This is used for ALTER ... OWNER TO. * This is used for ALTER ... OWNER TO.
*/ */
static void static void
_getObjectDescription(PQExpBuffer buf, TocEntry *te, ArchiveHandle *AH) _getObjectDescription(PQExpBuffer buf, TocEntry *te)
{ {
const char *type = te->desc; const char *type = te->desc;
...@@ -3674,7 +3672,7 @@ _printTocEntry(ArchiveHandle *AH, TocEntry *te, bool isData) ...@@ -3674,7 +3672,7 @@ _printTocEntry(ArchiveHandle *AH, TocEntry *te, bool isData)
PQExpBuffer temp = createPQExpBuffer(); PQExpBuffer temp = createPQExpBuffer();
appendPQExpBufferStr(temp, "ALTER "); appendPQExpBufferStr(temp, "ALTER ");
_getObjectDescription(temp, te, AH); _getObjectDescription(temp, te);
appendPQExpBuffer(temp, " OWNER TO %s;", fmtId(te->owner)); appendPQExpBuffer(temp, " OWNER TO %s;", fmtId(te->owner));
ahprintf(AH, "%s\n\n", temp->data); ahprintf(AH, "%s\n\n", temp->data);
destroyPQExpBuffer(temp); destroyPQExpBuffer(temp);
...@@ -4078,7 +4076,7 @@ restore_toc_entries_parallel(ArchiveHandle *AH, ParallelState *pstate, ...@@ -4078,7 +4076,7 @@ restore_toc_entries_parallel(ArchiveHandle *AH, ParallelState *pstate,
for (;;) for (;;)
{ {
/* Look for an item ready to be dispatched to a worker */ /* Look for an item ready to be dispatched to a worker */
next_work_item = pop_next_work_item(AH, &ready_list, pstate); next_work_item = pop_next_work_item(&ready_list, pstate);
if (next_work_item != NULL) if (next_work_item != NULL)
{ {
/* If not to be restored, don't waste time launching a worker */ /* If not to be restored, don't waste time launching a worker */
...@@ -4384,7 +4382,7 @@ move_to_ready_list(TocEntry *pending_list, ...@@ -4384,7 +4382,7 @@ move_to_ready_list(TocEntry *pending_list,
* no remaining dependencies, but we have to check for lock conflicts. * no remaining dependencies, but we have to check for lock conflicts.
*/ */
static TocEntry * static TocEntry *
pop_next_work_item(ArchiveHandle *AH, ParallelReadyList *ready_list, pop_next_work_item(ParallelReadyList *ready_list,
ParallelState *pstate) ParallelState *pstate)
{ {
/* /*
......
...@@ -107,7 +107,7 @@ static void tarClose(ArchiveHandle *AH, TAR_MEMBER *TH); ...@@ -107,7 +107,7 @@ static void tarClose(ArchiveHandle *AH, TAR_MEMBER *TH);
#ifdef __NOT_USED__ #ifdef __NOT_USED__
static char *tarGets(char *buf, size_t len, TAR_MEMBER *th); static char *tarGets(char *buf, size_t len, TAR_MEMBER *th);
#endif #endif
static int tarPrintf(ArchiveHandle *AH, TAR_MEMBER *th, const char *fmt,...) pg_attribute_printf(3, 4); static int tarPrintf(TAR_MEMBER *th, const char *fmt,...) pg_attribute_printf(2, 3);
static void _tarAddFile(ArchiveHandle *AH, TAR_MEMBER *th); static void _tarAddFile(ArchiveHandle *AH, TAR_MEMBER *th);
static TAR_MEMBER *_tarPositionTo(ArchiveHandle *AH, const char *filename); static TAR_MEMBER *_tarPositionTo(ArchiveHandle *AH, const char *filename);
...@@ -851,7 +851,7 @@ _CloseArchive(ArchiveHandle *AH) ...@@ -851,7 +851,7 @@ _CloseArchive(ArchiveHandle *AH)
*/ */
th = tarOpen(AH, "restore.sql", 'w'); th = tarOpen(AH, "restore.sql", 'w');
tarPrintf(AH, th, "--\n" tarPrintf(th, "--\n"
"-- NOTE:\n" "-- NOTE:\n"
"--\n" "--\n"
"-- File paths need to be edited. Search for $$PATH$$ and\n" "-- File paths need to be edited. Search for $$PATH$$ and\n"
...@@ -964,7 +964,7 @@ _StartBlob(ArchiveHandle *AH, TocEntry *te, Oid oid) ...@@ -964,7 +964,7 @@ _StartBlob(ArchiveHandle *AH, TocEntry *te, Oid oid)
sprintf(fname, "blob_%u.dat%s", oid, sfx); sprintf(fname, "blob_%u.dat%s", oid, sfx);
tarPrintf(AH, ctx->blobToc, "%u %s\n", oid, fname); tarPrintf(ctx->blobToc, "%u %s\n", oid, fname);
tctx->TH = tarOpen(AH, fname, 'w'); tctx->TH = tarOpen(AH, fname, 'w');
} }
...@@ -1008,7 +1008,7 @@ _EndBlobs(ArchiveHandle *AH, TocEntry *te) ...@@ -1008,7 +1008,7 @@ _EndBlobs(ArchiveHandle *AH, TocEntry *te)
*/ */
static int static int
tarPrintf(ArchiveHandle *AH, TAR_MEMBER *th, const char *fmt,...) tarPrintf(TAR_MEMBER *th, const char *fmt,...)
{ {
int save_errno = errno; int save_errno = errno;
char *p; char *p;
......
...@@ -157,7 +157,7 @@ static void expand_table_name_patterns(Archive *fout, ...@@ -157,7 +157,7 @@ static void expand_table_name_patterns(Archive *fout,
SimpleStringList *patterns, SimpleStringList *patterns,
SimpleOidList *oids, SimpleOidList *oids,
bool strict_names); bool strict_names);
static NamespaceInfo *findNamespace(Archive *fout, Oid nsoid); static NamespaceInfo *findNamespace(Oid nsoid);
static void dumpTableData(Archive *fout, TableDataInfo *tdinfo); static void dumpTableData(Archive *fout, TableDataInfo *tdinfo);
static void refreshMatViewData(Archive *fout, TableDataInfo *tdinfo); static void refreshMatViewData(Archive *fout, TableDataInfo *tdinfo);
static void guessConstraintInheritance(TableInfo *tblinfo, int numTables); static void guessConstraintInheritance(TableInfo *tblinfo, int numTables);
...@@ -250,9 +250,8 @@ static char *format_function_arguments_old(Archive *fout, ...@@ -250,9 +250,8 @@ static char *format_function_arguments_old(Archive *fout,
char **argnames); char **argnames);
static char *format_function_signature(Archive *fout, static char *format_function_signature(Archive *fout,
FuncInfo *finfo, bool honor_quotes); FuncInfo *finfo, bool honor_quotes);
static char *convertRegProcReference(Archive *fout, static char *convertRegProcReference(const char *proc);
const char *proc); static char *getFormattedOperatorName(const char *oproid);
static char *getFormattedOperatorName(Archive *fout, const char *oproid);
static char *convertTSFunction(Archive *fout, Oid funcOid); static char *convertTSFunction(Archive *fout, Oid funcOid);
static Oid findLastBuiltinOid_V71(Archive *fout); static Oid findLastBuiltinOid_V71(Archive *fout);
static char *getFormattedTypeName(Archive *fout, Oid oid, OidOptions opts); static char *getFormattedTypeName(Archive *fout, Oid oid, OidOptions opts);
...@@ -2974,7 +2973,7 @@ dumpDatabase(Archive *fout) ...@@ -2974,7 +2973,7 @@ dumpDatabase(Archive *fout)
seclabelQry = createPQExpBuffer(); seclabelQry = createPQExpBuffer();
buildShSecLabelQuery(conn, "pg_database", dbCatId.oid, seclabelQry); buildShSecLabelQuery("pg_database", dbCatId.oid, seclabelQry);
shres = ExecuteSqlQuery(fout, seclabelQry->data, PGRES_TUPLES_OK); shres = ExecuteSqlQuery(fout, seclabelQry->data, PGRES_TUPLES_OK);
resetPQExpBuffer(seclabelQry); resetPQExpBuffer(seclabelQry);
emitShSecLabels(conn, shres, seclabelQry, "DATABASE", datname); emitShSecLabels(conn, shres, seclabelQry, "DATABASE", datname);
...@@ -4811,7 +4810,7 @@ getNamespaces(Archive *fout, int *numNamespaces) ...@@ -4811,7 +4810,7 @@ getNamespaces(Archive *fout, int *numNamespaces)
* given a namespace OID, look up the info read by getNamespaces * given a namespace OID, look up the info read by getNamespaces
*/ */
static NamespaceInfo * static NamespaceInfo *
findNamespace(Archive *fout, Oid nsoid) findNamespace(Oid nsoid)
{ {
NamespaceInfo *nsinfo; NamespaceInfo *nsinfo;
...@@ -5069,8 +5068,7 @@ getTypes(Archive *fout, int *numTypes) ...@@ -5069,8 +5068,7 @@ getTypes(Archive *fout, int *numTypes)
AssignDumpId(&tyinfo[i].dobj); AssignDumpId(&tyinfo[i].dobj);
tyinfo[i].dobj.name = pg_strdup(PQgetvalue(res, i, i_typname)); tyinfo[i].dobj.name = pg_strdup(PQgetvalue(res, i, i_typname));
tyinfo[i].dobj.namespace = tyinfo[i].dobj.namespace =
findNamespace(fout, findNamespace(atooid(PQgetvalue(res, i, i_typnamespace)));
atooid(PQgetvalue(res, i, i_typnamespace)));
tyinfo[i].rolname = pg_strdup(PQgetvalue(res, i, i_rolname)); tyinfo[i].rolname = pg_strdup(PQgetvalue(res, i, i_rolname));
tyinfo[i].typacl = pg_strdup(PQgetvalue(res, i, i_typacl)); tyinfo[i].typacl = pg_strdup(PQgetvalue(res, i, i_typacl));
tyinfo[i].rtypacl = pg_strdup(PQgetvalue(res, i, i_rtypacl)); tyinfo[i].rtypacl = pg_strdup(PQgetvalue(res, i, i_rtypacl));
...@@ -5214,8 +5212,7 @@ getOperators(Archive *fout, int *numOprs) ...@@ -5214,8 +5212,7 @@ getOperators(Archive *fout, int *numOprs)
AssignDumpId(&oprinfo[i].dobj); AssignDumpId(&oprinfo[i].dobj);
oprinfo[i].dobj.name = pg_strdup(PQgetvalue(res, i, i_oprname)); oprinfo[i].dobj.name = pg_strdup(PQgetvalue(res, i, i_oprname));
oprinfo[i].dobj.namespace = oprinfo[i].dobj.namespace =
findNamespace(fout, findNamespace(atooid(PQgetvalue(res, i, i_oprnamespace)));
atooid(PQgetvalue(res, i, i_oprnamespace)));
oprinfo[i].rolname = pg_strdup(PQgetvalue(res, i, i_rolname)); oprinfo[i].rolname = pg_strdup(PQgetvalue(res, i, i_rolname));
oprinfo[i].oprkind = (PQgetvalue(res, i, i_oprkind))[0]; oprinfo[i].oprkind = (PQgetvalue(res, i, i_oprkind))[0];
oprinfo[i].oprcode = atooid(PQgetvalue(res, i, i_oprcode)); oprinfo[i].oprcode = atooid(PQgetvalue(res, i, i_oprcode));
...@@ -5300,8 +5297,7 @@ getCollations(Archive *fout, int *numCollations) ...@@ -5300,8 +5297,7 @@ getCollations(Archive *fout, int *numCollations)
AssignDumpId(&collinfo[i].dobj); AssignDumpId(&collinfo[i].dobj);
collinfo[i].dobj.name = pg_strdup(PQgetvalue(res, i, i_collname)); collinfo[i].dobj.name = pg_strdup(PQgetvalue(res, i, i_collname));
collinfo[i].dobj.namespace = collinfo[i].dobj.namespace =
findNamespace(fout, findNamespace(atooid(PQgetvalue(res, i, i_collnamespace)));
atooid(PQgetvalue(res, i, i_collnamespace)));
collinfo[i].rolname = pg_strdup(PQgetvalue(res, i, i_rolname)); collinfo[i].rolname = pg_strdup(PQgetvalue(res, i, i_rolname));
/* Decide whether we want to dump it */ /* Decide whether we want to dump it */
...@@ -5373,8 +5369,7 @@ getConversions(Archive *fout, int *numConversions) ...@@ -5373,8 +5369,7 @@ getConversions(Archive *fout, int *numConversions)
AssignDumpId(&convinfo[i].dobj); AssignDumpId(&convinfo[i].dobj);
convinfo[i].dobj.name = pg_strdup(PQgetvalue(res, i, i_conname)); convinfo[i].dobj.name = pg_strdup(PQgetvalue(res, i, i_conname));
convinfo[i].dobj.namespace = convinfo[i].dobj.namespace =
findNamespace(fout, findNamespace(atooid(PQgetvalue(res, i, i_connamespace)));
atooid(PQgetvalue(res, i, i_connamespace)));
convinfo[i].rolname = pg_strdup(PQgetvalue(res, i, i_rolname)); convinfo[i].rolname = pg_strdup(PQgetvalue(res, i, i_rolname));
/* Decide whether we want to dump it */ /* Decide whether we want to dump it */
...@@ -5518,8 +5513,7 @@ getOpclasses(Archive *fout, int *numOpclasses) ...@@ -5518,8 +5513,7 @@ getOpclasses(Archive *fout, int *numOpclasses)
AssignDumpId(&opcinfo[i].dobj); AssignDumpId(&opcinfo[i].dobj);
opcinfo[i].dobj.name = pg_strdup(PQgetvalue(res, i, i_opcname)); opcinfo[i].dobj.name = pg_strdup(PQgetvalue(res, i, i_opcname));
opcinfo[i].dobj.namespace = opcinfo[i].dobj.namespace =
findNamespace(fout, findNamespace(atooid(PQgetvalue(res, i, i_opcnamespace)));
atooid(PQgetvalue(res, i, i_opcnamespace)));
opcinfo[i].rolname = pg_strdup(PQgetvalue(res, i, i_rolname)); opcinfo[i].rolname = pg_strdup(PQgetvalue(res, i, i_rolname));
/* Decide whether we want to dump it */ /* Decide whether we want to dump it */
...@@ -5602,8 +5596,7 @@ getOpfamilies(Archive *fout, int *numOpfamilies) ...@@ -5602,8 +5596,7 @@ getOpfamilies(Archive *fout, int *numOpfamilies)
AssignDumpId(&opfinfo[i].dobj); AssignDumpId(&opfinfo[i].dobj);
opfinfo[i].dobj.name = pg_strdup(PQgetvalue(res, i, i_opfname)); opfinfo[i].dobj.name = pg_strdup(PQgetvalue(res, i, i_opfname));
opfinfo[i].dobj.namespace = opfinfo[i].dobj.namespace =
findNamespace(fout, findNamespace(atooid(PQgetvalue(res, i, i_opfnamespace)));
atooid(PQgetvalue(res, i, i_opfnamespace)));
opfinfo[i].rolname = pg_strdup(PQgetvalue(res, i, i_rolname)); opfinfo[i].rolname = pg_strdup(PQgetvalue(res, i, i_rolname));
/* Decide whether we want to dump it */ /* Decide whether we want to dump it */
...@@ -5778,8 +5771,7 @@ getAggregates(Archive *fout, int *numAggs) ...@@ -5778,8 +5771,7 @@ getAggregates(Archive *fout, int *numAggs)
AssignDumpId(&agginfo[i].aggfn.dobj); AssignDumpId(&agginfo[i].aggfn.dobj);
agginfo[i].aggfn.dobj.name = pg_strdup(PQgetvalue(res, i, i_aggname)); agginfo[i].aggfn.dobj.name = pg_strdup(PQgetvalue(res, i, i_aggname));
agginfo[i].aggfn.dobj.namespace = agginfo[i].aggfn.dobj.namespace =
findNamespace(fout, findNamespace(atooid(PQgetvalue(res, i, i_aggnamespace)));
atooid(PQgetvalue(res, i, i_aggnamespace)));
agginfo[i].aggfn.rolname = pg_strdup(PQgetvalue(res, i, i_rolname)); agginfo[i].aggfn.rolname = pg_strdup(PQgetvalue(res, i, i_rolname));
if (strlen(agginfo[i].aggfn.rolname) == 0) if (strlen(agginfo[i].aggfn.rolname) == 0)
pg_log_warning("owner of aggregate function \"%s\" appears to be invalid", pg_log_warning("owner of aggregate function \"%s\" appears to be invalid",
...@@ -6013,8 +6005,7 @@ getFuncs(Archive *fout, int *numFuncs) ...@@ -6013,8 +6005,7 @@ getFuncs(Archive *fout, int *numFuncs)
AssignDumpId(&finfo[i].dobj); AssignDumpId(&finfo[i].dobj);
finfo[i].dobj.name = pg_strdup(PQgetvalue(res, i, i_proname)); finfo[i].dobj.name = pg_strdup(PQgetvalue(res, i, i_proname));
finfo[i].dobj.namespace = finfo[i].dobj.namespace =
findNamespace(fout, findNamespace(atooid(PQgetvalue(res, i, i_pronamespace)));
atooid(PQgetvalue(res, i, i_pronamespace)));
finfo[i].rolname = pg_strdup(PQgetvalue(res, i, i_rolname)); finfo[i].rolname = pg_strdup(PQgetvalue(res, i, i_rolname));
finfo[i].lang = atooid(PQgetvalue(res, i, i_prolang)); finfo[i].lang = atooid(PQgetvalue(res, i, i_prolang));
finfo[i].prorettype = atooid(PQgetvalue(res, i, i_prorettype)); finfo[i].prorettype = atooid(PQgetvalue(res, i, i_prorettype));
...@@ -6751,8 +6742,7 @@ getTables(Archive *fout, int *numTables) ...@@ -6751,8 +6742,7 @@ getTables(Archive *fout, int *numTables)
AssignDumpId(&tblinfo[i].dobj); AssignDumpId(&tblinfo[i].dobj);
tblinfo[i].dobj.name = pg_strdup(PQgetvalue(res, i, i_relname)); tblinfo[i].dobj.name = pg_strdup(PQgetvalue(res, i, i_relname));
tblinfo[i].dobj.namespace = tblinfo[i].dobj.namespace =
findNamespace(fout, findNamespace(atooid(PQgetvalue(res, i, i_relnamespace)));
atooid(PQgetvalue(res, i, i_relnamespace)));
tblinfo[i].rolname = pg_strdup(PQgetvalue(res, i, i_rolname)); tblinfo[i].rolname = pg_strdup(PQgetvalue(res, i, i_rolname));
tblinfo[i].relacl = pg_strdup(PQgetvalue(res, i, i_relacl)); tblinfo[i].relacl = pg_strdup(PQgetvalue(res, i, i_relacl));
tblinfo[i].rrelacl = pg_strdup(PQgetvalue(res, i, i_rrelacl)); tblinfo[i].rrelacl = pg_strdup(PQgetvalue(res, i, i_rrelacl));
...@@ -7413,8 +7403,7 @@ getExtendedStatistics(Archive *fout) ...@@ -7413,8 +7403,7 @@ getExtendedStatistics(Archive *fout)
AssignDumpId(&statsextinfo[i].dobj); AssignDumpId(&statsextinfo[i].dobj);
statsextinfo[i].dobj.name = pg_strdup(PQgetvalue(res, i, i_stxname)); statsextinfo[i].dobj.name = pg_strdup(PQgetvalue(res, i, i_stxname));
statsextinfo[i].dobj.namespace = statsextinfo[i].dobj.namespace =
findNamespace(fout, findNamespace(atooid(PQgetvalue(res, i, i_stxnamespace)));
atooid(PQgetvalue(res, i, i_stxnamespace)));
statsextinfo[i].rolname = pg_strdup(PQgetvalue(res, i, i_rolname)); statsextinfo[i].rolname = pg_strdup(PQgetvalue(res, i, i_rolname));
statsextinfo[i].stattarget = atoi(PQgetvalue(res, i, i_stattarget)); statsextinfo[i].stattarget = atoi(PQgetvalue(res, i, i_stattarget));
...@@ -8952,8 +8941,7 @@ getTSParsers(Archive *fout, int *numTSParsers) ...@@ -8952,8 +8941,7 @@ getTSParsers(Archive *fout, int *numTSParsers)
AssignDumpId(&prsinfo[i].dobj); AssignDumpId(&prsinfo[i].dobj);
prsinfo[i].dobj.name = pg_strdup(PQgetvalue(res, i, i_prsname)); prsinfo[i].dobj.name = pg_strdup(PQgetvalue(res, i, i_prsname));
prsinfo[i].dobj.namespace = prsinfo[i].dobj.namespace =
findNamespace(fout, findNamespace(atooid(PQgetvalue(res, i, i_prsnamespace)));
atooid(PQgetvalue(res, i, i_prsnamespace)));
prsinfo[i].prsstart = atooid(PQgetvalue(res, i, i_prsstart)); prsinfo[i].prsstart = atooid(PQgetvalue(res, i, i_prsstart));
prsinfo[i].prstoken = atooid(PQgetvalue(res, i, i_prstoken)); prsinfo[i].prstoken = atooid(PQgetvalue(res, i, i_prstoken));
prsinfo[i].prsend = atooid(PQgetvalue(res, i, i_prsend)); prsinfo[i].prsend = atooid(PQgetvalue(res, i, i_prsend));
...@@ -9035,8 +9023,7 @@ getTSDictionaries(Archive *fout, int *numTSDicts) ...@@ -9035,8 +9023,7 @@ getTSDictionaries(Archive *fout, int *numTSDicts)
AssignDumpId(&dictinfo[i].dobj); AssignDumpId(&dictinfo[i].dobj);
dictinfo[i].dobj.name = pg_strdup(PQgetvalue(res, i, i_dictname)); dictinfo[i].dobj.name = pg_strdup(PQgetvalue(res, i, i_dictname));
dictinfo[i].dobj.namespace = dictinfo[i].dobj.namespace =
findNamespace(fout, findNamespace(atooid(PQgetvalue(res, i, i_dictnamespace)));
atooid(PQgetvalue(res, i, i_dictnamespace)));
dictinfo[i].rolname = pg_strdup(PQgetvalue(res, i, i_rolname)); dictinfo[i].rolname = pg_strdup(PQgetvalue(res, i, i_rolname));
dictinfo[i].dicttemplate = atooid(PQgetvalue(res, i, i_dicttemplate)); dictinfo[i].dicttemplate = atooid(PQgetvalue(res, i, i_dicttemplate));
if (PQgetisnull(res, i, i_dictinitoption)) if (PQgetisnull(res, i, i_dictinitoption))
...@@ -9115,8 +9102,7 @@ getTSTemplates(Archive *fout, int *numTSTemplates) ...@@ -9115,8 +9102,7 @@ getTSTemplates(Archive *fout, int *numTSTemplates)
AssignDumpId(&tmplinfo[i].dobj); AssignDumpId(&tmplinfo[i].dobj);
tmplinfo[i].dobj.name = pg_strdup(PQgetvalue(res, i, i_tmplname)); tmplinfo[i].dobj.name = pg_strdup(PQgetvalue(res, i, i_tmplname));
tmplinfo[i].dobj.namespace = tmplinfo[i].dobj.namespace =
findNamespace(fout, findNamespace(atooid(PQgetvalue(res, i, i_tmplnamespace)));
atooid(PQgetvalue(res, i, i_tmplnamespace)));
tmplinfo[i].tmplinit = atooid(PQgetvalue(res, i, i_tmplinit)); tmplinfo[i].tmplinit = atooid(PQgetvalue(res, i, i_tmplinit));
tmplinfo[i].tmpllexize = atooid(PQgetvalue(res, i, i_tmpllexize)); tmplinfo[i].tmpllexize = atooid(PQgetvalue(res, i, i_tmpllexize));
...@@ -9192,8 +9178,7 @@ getTSConfigurations(Archive *fout, int *numTSConfigs) ...@@ -9192,8 +9178,7 @@ getTSConfigurations(Archive *fout, int *numTSConfigs)
AssignDumpId(&cfginfo[i].dobj); AssignDumpId(&cfginfo[i].dobj);
cfginfo[i].dobj.name = pg_strdup(PQgetvalue(res, i, i_cfgname)); cfginfo[i].dobj.name = pg_strdup(PQgetvalue(res, i, i_cfgname));
cfginfo[i].dobj.namespace = cfginfo[i].dobj.namespace =
findNamespace(fout, findNamespace(atooid(PQgetvalue(res, i, i_cfgnamespace)));
atooid(PQgetvalue(res, i, i_cfgnamespace)));
cfginfo[i].rolname = pg_strdup(PQgetvalue(res, i, i_rolname)); cfginfo[i].rolname = pg_strdup(PQgetvalue(res, i, i_rolname));
cfginfo[i].cfgparser = atooid(PQgetvalue(res, i, i_cfgparser)); cfginfo[i].cfgparser = atooid(PQgetvalue(res, i, i_cfgparser));
...@@ -9640,7 +9625,7 @@ getDefaultACLs(Archive *fout, int *numDefaultACLs) ...@@ -9640,7 +9625,7 @@ getDefaultACLs(Archive *fout, int *numDefaultACLs)
daclinfo[i].dobj.name = pg_strdup(PQgetvalue(res, i, i_defaclobjtype)); daclinfo[i].dobj.name = pg_strdup(PQgetvalue(res, i, i_defaclobjtype));
if (nspid != InvalidOid) if (nspid != InvalidOid)
daclinfo[i].dobj.namespace = findNamespace(fout, nspid); daclinfo[i].dobj.namespace = findNamespace(nspid);
else else
daclinfo[i].dobj.namespace = NULL; daclinfo[i].dobj.namespace = NULL;
...@@ -12655,7 +12640,7 @@ dumpOpr(Archive *fout, OprInfo *oprinfo) ...@@ -12655,7 +12640,7 @@ dumpOpr(Archive *fout, OprInfo *oprinfo)
pg_log_warning("postfix operators are not supported anymore (operator \"%s\")", pg_log_warning("postfix operators are not supported anymore (operator \"%s\")",
oprcode); oprcode);
oprregproc = convertRegProcReference(fout, oprcode); oprregproc = convertRegProcReference(oprcode);
if (oprregproc) if (oprregproc)
{ {
appendPQExpBuffer(details, " FUNCTION = %s", oprregproc); appendPQExpBuffer(details, " FUNCTION = %s", oprregproc);
...@@ -12688,14 +12673,14 @@ dumpOpr(Archive *fout, OprInfo *oprinfo) ...@@ -12688,14 +12673,14 @@ dumpOpr(Archive *fout, OprInfo *oprinfo)
else else
appendPQExpBufferStr(oprid, ", NONE)"); appendPQExpBufferStr(oprid, ", NONE)");
oprref = getFormattedOperatorName(fout, oprcom); oprref = getFormattedOperatorName(oprcom);
if (oprref) if (oprref)
{ {
appendPQExpBuffer(details, ",\n COMMUTATOR = %s", oprref); appendPQExpBuffer(details, ",\n COMMUTATOR = %s", oprref);
free(oprref); free(oprref);
} }
oprref = getFormattedOperatorName(fout, oprnegate); oprref = getFormattedOperatorName(oprnegate);
if (oprref) if (oprref)
{ {
appendPQExpBuffer(details, ",\n NEGATOR = %s", oprref); appendPQExpBuffer(details, ",\n NEGATOR = %s", oprref);
...@@ -12708,14 +12693,14 @@ dumpOpr(Archive *fout, OprInfo *oprinfo) ...@@ -12708,14 +12693,14 @@ dumpOpr(Archive *fout, OprInfo *oprinfo)
if (strcmp(oprcanhash, "t") == 0) if (strcmp(oprcanhash, "t") == 0)
appendPQExpBufferStr(details, ",\n HASHES"); appendPQExpBufferStr(details, ",\n HASHES");
oprregproc = convertRegProcReference(fout, oprrest); oprregproc = convertRegProcReference(oprrest);
if (oprregproc) if (oprregproc)
{ {
appendPQExpBuffer(details, ",\n RESTRICT = %s", oprregproc); appendPQExpBuffer(details, ",\n RESTRICT = %s", oprregproc);
free(oprregproc); free(oprregproc);
} }
oprregproc = convertRegProcReference(fout, oprjoin); oprregproc = convertRegProcReference(oprjoin);
if (oprregproc) if (oprregproc)
{ {
appendPQExpBuffer(details, ",\n JOIN = %s", oprregproc); appendPQExpBuffer(details, ",\n JOIN = %s", oprregproc);
...@@ -12770,7 +12755,7 @@ dumpOpr(Archive *fout, OprInfo *oprinfo) ...@@ -12770,7 +12755,7 @@ dumpOpr(Archive *fout, OprInfo *oprinfo)
* part. * part.
*/ */
static char * static char *
convertRegProcReference(Archive *fout, const char *proc) convertRegProcReference(const char *proc)
{ {
char *name; char *name;
char *paren; char *paren;
...@@ -12811,7 +12796,7 @@ convertRegProcReference(Archive *fout, const char *proc) ...@@ -12811,7 +12796,7 @@ convertRegProcReference(Archive *fout, const char *proc)
* are in different schemas. * are in different schemas.
*/ */
static char * static char *
getFormattedOperatorName(Archive *fout, const char *oproid) getFormattedOperatorName(const char *oproid)
{ {
OprInfo *oprInfo; OprInfo *oprInfo;
...@@ -14121,7 +14106,7 @@ dumpAgg(Archive *fout, AggInfo *agginfo) ...@@ -14121,7 +14106,7 @@ dumpAgg(Archive *fout, AggInfo *agginfo)
} }
} }
aggsortconvop = getFormattedOperatorName(fout, aggsortop); aggsortconvop = getFormattedOperatorName(aggsortop);
if (aggsortconvop) if (aggsortconvop)
{ {
appendPQExpBuffer(details, ",\n SORTOP = %s", appendPQExpBuffer(details, ",\n SORTOP = %s",
......
...@@ -1614,7 +1614,7 @@ buildShSecLabels(PGconn *conn, const char *catalog_name, Oid objectId, ...@@ -1614,7 +1614,7 @@ buildShSecLabels(PGconn *conn, const char *catalog_name, Oid objectId,
PQExpBuffer sql = createPQExpBuffer(); PQExpBuffer sql = createPQExpBuffer();
PGresult *res; PGresult *res;
buildShSecLabelQuery(conn, catalog_name, objectId, sql); buildShSecLabelQuery(catalog_name, objectId, sql);
res = executeQuery(conn, sql->data); res = executeQuery(conn, sql->data);
emitShSecLabels(conn, res, buffer, objtype, objname); emitShSecLabels(conn, res, buffer, objtype, objname);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment