From 7156bfe25b861e5d4b9467ea13e54096e4b14c76 Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Tue, 25 Aug 2020 07:24:15 +0200 Subject: [PATCH 07/11] Remove unused parameters unused since 64f3524e2c8deebc02808aa5ebdfa17859473add --- src/bin/pg_dump/pg_dump.c | 69 +++++++++++++++------------------------ 1 file changed, 27 insertions(+), 42 deletions(-) diff --git a/src/bin/pg_dump/pg_dump.c b/src/bin/pg_dump/pg_dump.c index 2cb3f9b083..63c0d84746 100644 --- a/src/bin/pg_dump/pg_dump.c +++ b/src/bin/pg_dump/pg_dump.c @@ -157,7 +157,7 @@ static void expand_table_name_patterns(Archive *fout, SimpleStringList *patterns, SimpleOidList *oids, bool strict_names); -static NamespaceInfo *findNamespace(Archive *fout, Oid nsoid); +static NamespaceInfo *findNamespace(Oid nsoid); static void dumpTableData(Archive *fout, TableDataInfo *tdinfo); static void refreshMatViewData(Archive *fout, TableDataInfo *tdinfo); static void guessConstraintInheritance(TableInfo *tblinfo, int numTables); @@ -250,9 +250,8 @@ static char *format_function_arguments_old(Archive *fout, char **argnames); static char *format_function_signature(Archive *fout, FuncInfo *finfo, bool honor_quotes); -static char *convertRegProcReference(Archive *fout, - const char *proc); -static char *getFormattedOperatorName(Archive *fout, const char *oproid); +static char *convertRegProcReference(const char *proc); +static char *getFormattedOperatorName(const char *oproid); static char *convertTSFunction(Archive *fout, Oid funcOid); static Oid findLastBuiltinOid_V71(Archive *fout); static char *getFormattedTypeName(Archive *fout, Oid oid, OidOptions opts); @@ -4795,7 +4794,7 @@ getNamespaces(Archive *fout, int *numNamespaces) * given a namespace OID, look up the info read by getNamespaces */ static NamespaceInfo * -findNamespace(Archive *fout, Oid nsoid) +findNamespace(Oid nsoid) { NamespaceInfo *nsinfo; @@ -5053,8 +5052,7 @@ getTypes(Archive *fout, int *numTypes) AssignDumpId(&tyinfo[i].dobj); tyinfo[i].dobj.name = pg_strdup(PQgetvalue(res, i, i_typname)); tyinfo[i].dobj.namespace = - findNamespace(fout, - atooid(PQgetvalue(res, i, i_typnamespace))); + findNamespace(atooid(PQgetvalue(res, i, i_typnamespace))); tyinfo[i].rolname = pg_strdup(PQgetvalue(res, i, i_rolname)); tyinfo[i].typacl = pg_strdup(PQgetvalue(res, i, i_typacl)); tyinfo[i].rtypacl = pg_strdup(PQgetvalue(res, i, i_rtypacl)); @@ -5198,8 +5196,7 @@ getOperators(Archive *fout, int *numOprs) AssignDumpId(&oprinfo[i].dobj); oprinfo[i].dobj.name = pg_strdup(PQgetvalue(res, i, i_oprname)); oprinfo[i].dobj.namespace = - findNamespace(fout, - atooid(PQgetvalue(res, i, i_oprnamespace))); + findNamespace(atooid(PQgetvalue(res, i, i_oprnamespace))); oprinfo[i].rolname = pg_strdup(PQgetvalue(res, i, i_rolname)); oprinfo[i].oprkind = (PQgetvalue(res, i, i_oprkind))[0]; oprinfo[i].oprcode = atooid(PQgetvalue(res, i, i_oprcode)); @@ -5284,8 +5281,7 @@ getCollations(Archive *fout, int *numCollations) AssignDumpId(&collinfo[i].dobj); collinfo[i].dobj.name = pg_strdup(PQgetvalue(res, i, i_collname)); collinfo[i].dobj.namespace = - findNamespace(fout, - atooid(PQgetvalue(res, i, i_collnamespace))); + findNamespace(atooid(PQgetvalue(res, i, i_collnamespace))); collinfo[i].rolname = pg_strdup(PQgetvalue(res, i, i_rolname)); /* Decide whether we want to dump it */ @@ -5357,8 +5353,7 @@ getConversions(Archive *fout, int *numConversions) AssignDumpId(&convinfo[i].dobj); convinfo[i].dobj.name = pg_strdup(PQgetvalue(res, i, i_conname)); convinfo[i].dobj.namespace = - findNamespace(fout, - atooid(PQgetvalue(res, i, i_connamespace))); + findNamespace(atooid(PQgetvalue(res, i, i_connamespace))); convinfo[i].rolname = pg_strdup(PQgetvalue(res, i, i_rolname)); /* Decide whether we want to dump it */ @@ -5502,8 +5497,7 @@ getOpclasses(Archive *fout, int *numOpclasses) AssignDumpId(&opcinfo[i].dobj); opcinfo[i].dobj.name = pg_strdup(PQgetvalue(res, i, i_opcname)); opcinfo[i].dobj.namespace = - findNamespace(fout, - atooid(PQgetvalue(res, i, i_opcnamespace))); + findNamespace(atooid(PQgetvalue(res, i, i_opcnamespace))); opcinfo[i].rolname = pg_strdup(PQgetvalue(res, i, i_rolname)); /* Decide whether we want to dump it */ @@ -5586,8 +5580,7 @@ getOpfamilies(Archive *fout, int *numOpfamilies) AssignDumpId(&opfinfo[i].dobj); opfinfo[i].dobj.name = pg_strdup(PQgetvalue(res, i, i_opfname)); opfinfo[i].dobj.namespace = - findNamespace(fout, - atooid(PQgetvalue(res, i, i_opfnamespace))); + findNamespace(atooid(PQgetvalue(res, i, i_opfnamespace))); opfinfo[i].rolname = pg_strdup(PQgetvalue(res, i, i_rolname)); /* Decide whether we want to dump it */ @@ -5762,8 +5755,7 @@ getAggregates(Archive *fout, int *numAggs) AssignDumpId(&agginfo[i].aggfn.dobj); agginfo[i].aggfn.dobj.name = pg_strdup(PQgetvalue(res, i, i_aggname)); agginfo[i].aggfn.dobj.namespace = - findNamespace(fout, - atooid(PQgetvalue(res, i, i_aggnamespace))); + findNamespace(atooid(PQgetvalue(res, i, i_aggnamespace))); agginfo[i].aggfn.rolname = pg_strdup(PQgetvalue(res, i, i_rolname)); if (strlen(agginfo[i].aggfn.rolname) == 0) pg_log_warning("owner of aggregate function \"%s\" appears to be invalid", @@ -5997,8 +5989,7 @@ getFuncs(Archive *fout, int *numFuncs) AssignDumpId(&finfo[i].dobj); finfo[i].dobj.name = pg_strdup(PQgetvalue(res, i, i_proname)); finfo[i].dobj.namespace = - findNamespace(fout, - atooid(PQgetvalue(res, i, i_pronamespace))); + findNamespace(atooid(PQgetvalue(res, i, i_pronamespace))); finfo[i].rolname = pg_strdup(PQgetvalue(res, i, i_rolname)); finfo[i].lang = atooid(PQgetvalue(res, i, i_prolang)); finfo[i].prorettype = atooid(PQgetvalue(res, i, i_prorettype)); @@ -6735,8 +6726,7 @@ getTables(Archive *fout, int *numTables) AssignDumpId(&tblinfo[i].dobj); tblinfo[i].dobj.name = pg_strdup(PQgetvalue(res, i, i_relname)); tblinfo[i].dobj.namespace = - findNamespace(fout, - atooid(PQgetvalue(res, i, i_relnamespace))); + findNamespace(atooid(PQgetvalue(res, i, i_relnamespace))); tblinfo[i].rolname = pg_strdup(PQgetvalue(res, i, i_rolname)); tblinfo[i].relacl = pg_strdup(PQgetvalue(res, i, i_relacl)); tblinfo[i].rrelacl = pg_strdup(PQgetvalue(res, i, i_rrelacl)); @@ -7397,8 +7387,7 @@ getExtendedStatistics(Archive *fout) AssignDumpId(&statsextinfo[i].dobj); statsextinfo[i].dobj.name = pg_strdup(PQgetvalue(res, i, i_stxname)); statsextinfo[i].dobj.namespace = - findNamespace(fout, - atooid(PQgetvalue(res, i, i_stxnamespace))); + findNamespace(atooid(PQgetvalue(res, i, i_stxnamespace))); statsextinfo[i].rolname = pg_strdup(PQgetvalue(res, i, i_rolname)); statsextinfo[i].stattarget = atoi(PQgetvalue(res, i, i_stattarget)); @@ -8934,8 +8923,7 @@ getTSParsers(Archive *fout, int *numTSParsers) AssignDumpId(&prsinfo[i].dobj); prsinfo[i].dobj.name = pg_strdup(PQgetvalue(res, i, i_prsname)); prsinfo[i].dobj.namespace = - findNamespace(fout, - atooid(PQgetvalue(res, i, i_prsnamespace))); + findNamespace(atooid(PQgetvalue(res, i, i_prsnamespace))); prsinfo[i].prsstart = atooid(PQgetvalue(res, i, i_prsstart)); prsinfo[i].prstoken = atooid(PQgetvalue(res, i, i_prstoken)); prsinfo[i].prsend = atooid(PQgetvalue(res, i, i_prsend)); @@ -9017,8 +9005,7 @@ getTSDictionaries(Archive *fout, int *numTSDicts) AssignDumpId(&dictinfo[i].dobj); dictinfo[i].dobj.name = pg_strdup(PQgetvalue(res, i, i_dictname)); dictinfo[i].dobj.namespace = - findNamespace(fout, - atooid(PQgetvalue(res, i, i_dictnamespace))); + findNamespace(atooid(PQgetvalue(res, i, i_dictnamespace))); dictinfo[i].rolname = pg_strdup(PQgetvalue(res, i, i_rolname)); dictinfo[i].dicttemplate = atooid(PQgetvalue(res, i, i_dicttemplate)); if (PQgetisnull(res, i, i_dictinitoption)) @@ -9097,8 +9084,7 @@ getTSTemplates(Archive *fout, int *numTSTemplates) AssignDumpId(&tmplinfo[i].dobj); tmplinfo[i].dobj.name = pg_strdup(PQgetvalue(res, i, i_tmplname)); tmplinfo[i].dobj.namespace = - findNamespace(fout, - atooid(PQgetvalue(res, i, i_tmplnamespace))); + findNamespace(atooid(PQgetvalue(res, i, i_tmplnamespace))); tmplinfo[i].tmplinit = atooid(PQgetvalue(res, i, i_tmplinit)); tmplinfo[i].tmpllexize = atooid(PQgetvalue(res, i, i_tmpllexize)); @@ -9174,8 +9160,7 @@ getTSConfigurations(Archive *fout, int *numTSConfigs) AssignDumpId(&cfginfo[i].dobj); cfginfo[i].dobj.name = pg_strdup(PQgetvalue(res, i, i_cfgname)); cfginfo[i].dobj.namespace = - findNamespace(fout, - atooid(PQgetvalue(res, i, i_cfgnamespace))); + findNamespace(atooid(PQgetvalue(res, i, i_cfgnamespace))); cfginfo[i].rolname = pg_strdup(PQgetvalue(res, i, i_rolname)); cfginfo[i].cfgparser = atooid(PQgetvalue(res, i, i_cfgparser)); @@ -9622,7 +9607,7 @@ getDefaultACLs(Archive *fout, int *numDefaultACLs) daclinfo[i].dobj.name = pg_strdup(PQgetvalue(res, i, i_defaclobjtype)); if (nspid != InvalidOid) - daclinfo[i].dobj.namespace = findNamespace(fout, nspid); + daclinfo[i].dobj.namespace = findNamespace(nspid); else daclinfo[i].dobj.namespace = NULL; @@ -12632,7 +12617,7 @@ dumpOpr(Archive *fout, OprInfo *oprinfo) oprcanmerge = PQgetvalue(res, 0, i_oprcanmerge); oprcanhash = PQgetvalue(res, 0, i_oprcanhash); - oprregproc = convertRegProcReference(fout, oprcode); + oprregproc = convertRegProcReference(oprcode); if (oprregproc) { appendPQExpBuffer(details, " FUNCTION = %s", oprregproc); @@ -12664,14 +12649,14 @@ dumpOpr(Archive *fout, OprInfo *oprinfo) else appendPQExpBufferStr(oprid, ", NONE)"); - oprref = getFormattedOperatorName(fout, oprcom); + oprref = getFormattedOperatorName(oprcom); if (oprref) { appendPQExpBuffer(details, ",\n COMMUTATOR = %s", oprref); free(oprref); } - oprref = getFormattedOperatorName(fout, oprnegate); + oprref = getFormattedOperatorName(oprnegate); if (oprref) { appendPQExpBuffer(details, ",\n NEGATOR = %s", oprref); @@ -12684,14 +12669,14 @@ dumpOpr(Archive *fout, OprInfo *oprinfo) if (strcmp(oprcanhash, "t") == 0) appendPQExpBufferStr(details, ",\n HASHES"); - oprregproc = convertRegProcReference(fout, oprrest); + oprregproc = convertRegProcReference(oprrest); if (oprregproc) { appendPQExpBuffer(details, ",\n RESTRICT = %s", oprregproc); free(oprregproc); } - oprregproc = convertRegProcReference(fout, oprjoin); + oprregproc = convertRegProcReference(oprjoin); if (oprregproc) { appendPQExpBuffer(details, ",\n JOIN = %s", oprregproc); @@ -12746,7 +12731,7 @@ dumpOpr(Archive *fout, OprInfo *oprinfo) * part. */ static char * -convertRegProcReference(Archive *fout, const char *proc) +convertRegProcReference(const char *proc) { char *name; char *paren; @@ -12787,7 +12772,7 @@ convertRegProcReference(Archive *fout, const char *proc) * are in different schemas. */ static char * -getFormattedOperatorName(Archive *fout, const char *oproid) +getFormattedOperatorName(const char *oproid) { OprInfo *oprInfo; @@ -14097,7 +14082,7 @@ dumpAgg(Archive *fout, AggInfo *agginfo) } } - aggsortconvop = getFormattedOperatorName(fout, aggsortop); + aggsortconvop = getFormattedOperatorName(aggsortop); if (aggsortconvop) { appendPQExpBuffer(details, ",\n SORTOP = %s", -- 2.28.0