aliasname_q = quote_identifier(aliasname);
/* deparse SELECT clause */
- appendStringInfo(sql, "SELECT ");
+ appendStringInfoString(sql, "SELECT ");
/*
* TODO: omit (deparse to "NULL") columns which are not used in the
/* if target list is composed only of system attributes, add dummy column */
if (first)
- appendStringInfo(sql, "NULL");
+ appendStringInfoString(sql, "NULL");
if (aliasname_q != aliasname)
pfree((char *) aliasname_q);
/* The alias of relation is used in both SELECT clause and FROM clause. */
aliasname_q = quote_identifier(aliasname);
- /* deparse FROM clause */
- appendStringInfo(sql, " FROM ");
-
/*
* If the foreign table has generic option "nspname" and/or "relname", use
* them in the foreign query. Otherwise, use local catalog names.
relname = get_rel_name(table->relid);
nspname_q = quote_identifier(nspname);
relname_q = quote_identifier(relname);
- appendStringInfo(sql, "%s.%s %s", nspname_q, relname_q, aliasname_q);
+ appendStringInfo(sql, " FROM %s.%s %s", nspname_q, relname_q, aliasname_q);
pfree(nspname);
pfree(relname);
if (nspname_q != nspname)
{
Node *node;
node = (Node *) make_ands_explicit(foreign_expr);
- appendStringInfo(&sql, " WHERE ");
- appendStringInfo(&sql,
+ appendStringInfo(&sql, " WHERE %s",
deparse_expression(node, context, prefix, false));
/*
* The contents of the list MUST NOT be free-ed because they are