static ArchiveHandle *_allocAH(const char *FileSpec, const ArchiveFormat fmt,
const int compression, bool dosync, ArchiveMode mode,
SetupWorkerPtrType setupWorkerPtr);
-static void _getObjectDescription(PQExpBuffer buf, TocEntry *te,
- ArchiveHandle *AH);
+static void _getObjectDescription(PQExpBuffer buf, TocEntry *te);
static void _printTocEntry(ArchiveHandle *AH, TocEntry *te, bool isData);
static char *sanitize_line(const char *str, bool want_hyphen);
static void _doSetFixedOutputState(ArchiveHandle *AH);
static void _disableTriggersIfNecessary(ArchiveHandle *AH, TocEntry *te);
static void _enableTriggersIfNecessary(ArchiveHandle *AH, TocEntry *te);
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 RestoringToDB(ArchiveHandle *AH);
static void move_to_ready_list(TocEntry *pending_list,
ParallelReadyList *ready_list,
RestorePass pass);
-static TocEntry *pop_next_work_item(ArchiveHandle *AH,
- ParallelReadyList *ready_list,
+static TocEntry *pop_next_work_item(ParallelReadyList *ready_list,
ParallelState *pstate);
static void mark_dump_job_done(ArchiveHandle *AH,
TocEntry *te,
* side-effects on the order in which restorable items actually get
* restored.
*/
- _moveBefore(AH, AH->toc, te);
+ _moveBefore(AH->toc, te);
}
if (fclose(fh) != 0)
#endif
static void
-_moveBefore(ArchiveHandle *AH, TocEntry *pos, TocEntry *te)
+_moveBefore(TocEntry *pos, TocEntry *te)
{
/* Unlink te from list */
te->prev->next = te->next;
* This is used for ALTER ... OWNER TO.
*/
static void
-_getObjectDescription(PQExpBuffer buf, TocEntry *te, ArchiveHandle *AH)
+_getObjectDescription(PQExpBuffer buf, TocEntry *te)
{
const char *type = te->desc;
PQExpBuffer temp = createPQExpBuffer();
appendPQExpBufferStr(temp, "ALTER ");
- _getObjectDescription(temp, te, AH);
+ _getObjectDescription(temp, te);
appendPQExpBuffer(temp, " OWNER TO %s;", fmtId(te->owner));
ahprintf(AH, "%s\n\n", temp->data);
destroyPQExpBuffer(temp);
for (;;)
{
/* 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 not to be restored, don't waste time launching a worker */
* no remaining dependencies, but we have to check for lock conflicts.
*/
static TocEntry *
-pop_next_work_item(ArchiveHandle *AH, ParallelReadyList *ready_list,
+pop_next_work_item(ParallelReadyList *ready_list,
ParallelState *pstate)
{
/*
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);
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);
seclabelQry = createPQExpBuffer();
- buildShSecLabelQuery(conn, "pg_database", dbCatId.oid, seclabelQry);
+ buildShSecLabelQuery("pg_database", dbCatId.oid, seclabelQry);
shres = ExecuteSqlQuery(fout, seclabelQry->data, PGRES_TUPLES_OK);
resetPQExpBuffer(seclabelQry);
emitShSecLabels(conn, shres, seclabelQry, "DATABASE", datname);
* given a namespace OID, look up the info read by getNamespaces
*/
static NamespaceInfo *
-findNamespace(Archive *fout, Oid nsoid)
+findNamespace(Oid nsoid)
{
NamespaceInfo *nsinfo;
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));
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));
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 */
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 */
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 */
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 */
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",
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));
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));
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));
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));
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))
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));
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));
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;
pg_log_warning("postfix operators are not supported anymore (operator \"%s\")",
oprcode);
- oprregproc = convertRegProcReference(fout, oprcode);
+ oprregproc = convertRegProcReference(oprcode);
if (oprregproc)
{
appendPQExpBuffer(details, " FUNCTION = %s", oprregproc);
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);
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);
* part.
*/
static char *
-convertRegProcReference(Archive *fout, const char *proc)
+convertRegProcReference(const char *proc)
{
char *name;
char *paren;
* are in different schemas.
*/
static char *
-getFormattedOperatorName(Archive *fout, const char *oproid)
+getFormattedOperatorName(const char *oproid)
{
OprInfo *oprInfo;
}
}
- aggsortconvop = getFormattedOperatorName(fout, aggsortop);
+ aggsortconvop = getFormattedOperatorName(aggsortop);
if (aggsortconvop)
{
appendPQExpBuffer(details, ",\n SORTOP = %s",