diff options
author | David Rowley | 2019-07-04 01:01:13 +0000 |
---|---|---|
committer | David Rowley | 2019-07-04 01:01:13 +0000 |
commit | 8abc13a88938ef473b8a486186f1b96630450728 (patch) | |
tree | 111864d4f940154a6fd64fd50bc528d396ccde30 /contrib | |
parent | 5683b34956b4e8da9dccadc2e3a53b86104ebb33 (diff) |
Use appendStringInfoString and appendPQExpBufferStr where possible
This changes various places where appendPQExpBuffer was used in places
where it was possible to use appendPQExpBufferStr, and likewise for
appendStringInfo and appendStringInfoString. This is really just a
stylistic improvement, but there are also small performance gains to be
had from doing this.
Discussion: http://postgr.es/m/CAKJS1f9P=M-3ULmPvr8iCno8yvfDViHibJjpriHU8+SXUgeZ=w@mail.gmail.com
Diffstat (limited to 'contrib')
-rw-r--r-- | contrib/postgres_fdw/deparse.c | 8 | ||||
-rw-r--r-- | contrib/sepgsql/database.c | 6 | ||||
-rw-r--r-- | contrib/sepgsql/label.c | 2 | ||||
-rw-r--r-- | contrib/sepgsql/selinux.c | 2 | ||||
-rw-r--r-- | contrib/test_decoding/test_decoding.c | 4 |
5 files changed, 11 insertions, 11 deletions
diff --git a/contrib/postgres_fdw/deparse.c b/contrib/postgres_fdw/deparse.c index 6da4c834bf..b951b11592 100644 --- a/contrib/postgres_fdw/deparse.c +++ b/contrib/postgres_fdw/deparse.c @@ -1531,7 +1531,7 @@ deparseFromExprForRel(StringInfo buf, PlannerInfo *root, RelOptInfo *foreignrel, { Assert(fpinfo->jointype == JOIN_INNER); Assert(fpinfo->joinclauses == NIL); - appendStringInfo(buf, "%s", join_sql_o.data); + appendStringInfoString(buf, join_sql_o.data); return; } } @@ -1552,7 +1552,7 @@ deparseFromExprForRel(StringInfo buf, PlannerInfo *root, RelOptInfo *foreignrel, { Assert(fpinfo->jointype == JOIN_INNER); Assert(fpinfo->joinclauses == NIL); - appendStringInfo(buf, "%s", join_sql_i.data); + appendStringInfoString(buf, join_sql_i.data); return; } } @@ -1861,7 +1861,7 @@ deparseDirectUpdateSql(StringInfo buf, PlannerInfo *root, { List *ignore_conds = NIL; - appendStringInfo(buf, " FROM "); + appendStringInfoString(buf, " FROM "); deparseFromExprForRel(buf, root, foreignrel, true, rtindex, &ignore_conds, params_list); remote_conds = list_concat(remote_conds, ignore_conds); @@ -1944,7 +1944,7 @@ deparseDirectDeleteSql(StringInfo buf, PlannerInfo *root, { List *ignore_conds = NIL; - appendStringInfo(buf, " USING "); + appendStringInfoString(buf, " USING "); deparseFromExprForRel(buf, root, foreignrel, true, rtindex, &ignore_conds, params_list); remote_conds = list_concat(remote_conds, ignore_conds); diff --git a/contrib/sepgsql/database.c b/contrib/sepgsql/database.c index 0cffb69c76..8edd3df643 100644 --- a/contrib/sepgsql/database.c +++ b/contrib/sepgsql/database.c @@ -63,7 +63,7 @@ sepgsql_database_post_create(Oid databaseId, const char *dtemplate) * check db_database:{getattr} permission */ initStringInfo(&audit_name); - appendStringInfo(&audit_name, "%s", quote_identifier(dtemplate)); + appendStringInfoString(&audit_name, quote_identifier(dtemplate)); sepgsql_avc_check_perms_label(tcontext, SEPG_CLASS_DB_DATABASE, SEPG_DB_DATABASE__GETATTR, @@ -101,8 +101,8 @@ sepgsql_database_post_create(Oid databaseId, const char *dtemplate) * check db_database:{create} permission */ resetStringInfo(&audit_name); - appendStringInfo(&audit_name, "%s", - quote_identifier(NameStr(datForm->datname))); + appendStringInfoString(&audit_name, + quote_identifier(NameStr(datForm->datname))); sepgsql_avc_check_perms_label(ncontext, SEPG_CLASS_DB_DATABASE, SEPG_DB_DATABASE__CREATE, diff --git a/contrib/sepgsql/label.c b/contrib/sepgsql/label.c index 0b0d21c7f5..1d17d5a0c0 100644 --- a/contrib/sepgsql/label.c +++ b/contrib/sepgsql/label.c @@ -676,7 +676,7 @@ quote_object_name(const char *src1, const char *src2, if (src1) { temp = quote_identifier(src1); - appendStringInfo(&result, "%s", temp); + appendStringInfoString(&result, temp); if (src1 != temp) pfree((void *) temp); } diff --git a/contrib/sepgsql/selinux.c b/contrib/sepgsql/selinux.c index fbc044e818..bc2be8427a 100644 --- a/contrib/sepgsql/selinux.c +++ b/contrib/sepgsql/selinux.c @@ -702,7 +702,7 @@ sepgsql_audit_log(bool denied, appendStringInfo(&buf, " %s", av_name); } } - appendStringInfo(&buf, " }"); + appendStringInfoString(&buf, " }"); /* * Call external audit module, if loaded diff --git a/contrib/test_decoding/test_decoding.c b/contrib/test_decoding/test_decoding.c index 33955a478e..a0ded67b9a 100644 --- a/contrib/test_decoding/test_decoding.c +++ b/contrib/test_decoding/test_decoding.c @@ -518,9 +518,9 @@ pg_decode_truncate(LogicalDecodingContext *ctx, ReorderBufferTXN *txn, || change->data.truncate.cascade) { if (change->data.truncate.restart_seqs) - appendStringInfo(ctx->out, " restart_seqs"); + appendStringInfoString(ctx->out, " restart_seqs"); if (change->data.truncate.cascade) - appendStringInfo(ctx->out, " cascade"); + appendStringInfoString(ctx->out, " cascade"); } else appendStringInfoString(ctx->out, " (no-flags)"); |