aboutsummaryrefslogtreecommitdiff
path: root/contrib/postgres_fdw
diff options
context:
space:
mode:
authorDavid Rowley <drowley@postgresql.org>2024-04-10 11:53:32 +1200
committerDavid Rowley <drowley@postgresql.org>2024-04-10 11:53:32 +1200
commit8461424fd717877ead0706984ef9b6440b2a97ad (patch)
treeac5ee13afb549d4f44830d8ac6d08d846e1c1b74 /contrib/postgres_fdw
parentff9f72c68f678ded340b431c3e280fe56644a3e7 (diff)
downloadpostgresql-8461424fd717877ead0706984ef9b6440b2a97ad.tar.gz
postgresql-8461424fd717877ead0706984ef9b6440b2a97ad.zip
Fixup various StringInfo function usages
This adjusts various appendStringInfo* function calls to use a more appropriate and efficient function with the same behavior. For example, use appendStringInfoChar() when appending a single character rather than appendStringInfo() and appendStringInfoString() when no formatting is required rather than using appendStringInfo(). All adjustments made here are in code that's new to v17, so it makes sense to fix these now rather than wait a few years and make backpatching harder. Discussion: https://postgr.es/m/CAApHDvojY2UvMiO+9_55ArTj10P1LBNJyyoGB+C65BLDNT0GsQ@mail.gmail.com Reviewed-by: Nathan Bossart, Tom Lane
Diffstat (limited to 'contrib/postgres_fdw')
-rw-r--r--contrib/postgres_fdw/deparse.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/contrib/postgres_fdw/deparse.c b/contrib/postgres_fdw/deparse.c
index ce765ecc904..fb590c87e67 100644
--- a/contrib/postgres_fdw/deparse.c
+++ b/contrib/postgres_fdw/deparse.c
@@ -1887,7 +1887,7 @@ deparseFromExprForRel(StringInfo buf, PlannerInfo *root, RelOptInfo *foreignrel,
}
/* Close parentheses for EXISTS subquery */
- appendStringInfo(&str, ")");
+ appendStringInfoChar(&str, ')');
*additional_conds = lappend(*additional_conds, str.data);
}
@@ -1921,7 +1921,7 @@ deparseFromExprForRel(StringInfo buf, PlannerInfo *root, RelOptInfo *foreignrel,
*/
if (fpinfo->jointype == JOIN_SEMI)
{
- appendStringInfo(buf, "%s", join_sql_o.data);
+ appendBinaryStringInfo(buf, join_sql_o.data, join_sql_o.len);
}
else
{