ForeignServer *foreign_server = NULL;
UserMapping *user_mapping;
ListCell *cell;
- StringInfo buf = makeStringInfo();
+ StringInfoData buf;
ForeignDataWrapper *fdw;
AclResult aclresult;
char *srvname;
static const PQconninfoOption *options = NULL;
+ initStringInfo(&buf);
+
/*
* Get list of valid libpq options.
*
DefElem *def = lfirst(cell);
if (is_valid_dblink_option(options, def->defname, ForeignDataWrapperRelationId))
- appendStringInfo(buf, "%s='%s' ", def->defname,
+ appendStringInfo(&buf, "%s='%s' ", def->defname,
escape_param_str(strVal(def->arg)));
}
DefElem *def = lfirst(cell);
if (is_valid_dblink_option(options, def->defname, ForeignServerRelationId))
- appendStringInfo(buf, "%s='%s' ", def->defname,
+ appendStringInfo(&buf, "%s='%s' ", def->defname,
escape_param_str(strVal(def->arg)));
}
DefElem *def = lfirst(cell);
if (is_valid_dblink_option(options, def->defname, UserMappingRelationId))
- appendStringInfo(buf, "%s='%s' ", def->defname,
+ appendStringInfo(&buf, "%s='%s' ", def->defname,
escape_param_str(strVal(def->arg)));
}
- return buf->data;
+ return buf.data;
}
else
return NULL;
escape_param_str(const char *str)
{
const char *cp;
- StringInfo buf = makeStringInfo();
+ StringInfoData buf;
+
+ initStringInfo(&buf);
for (cp = str; *cp; cp++)
{
if (*cp == '\\' || *cp == '\'')
- appendStringInfoChar(buf, '\\');
- appendStringInfoChar(buf, *cp);
+ appendStringInfoChar(&buf, '\\');
+ appendStringInfoChar(&buf, *cp);
}
- return buf->data;
+ return buf.data;
}
/*