summaryrefslogtreecommitdiff
path: root/src/backend/utils/adt/ri_triggers.c
diff options
context:
space:
mode:
authorDavid Rowley <drowley@postgresql.org>2025-04-11 10:07:22 +1200
committerDavid Rowley <drowley@postgresql.org>2025-04-11 10:07:22 +1200
commit928394b664bc4afef2fe6dc69a70e4074886e065 (patch)
tree820653f798f03379ef7f14108ddbabc5219a45ba /src/backend/utils/adt/ri_triggers.c
parent55ef7abf88c07e9f716846e645e1628c667c54a7 (diff)
Improve various new-to-v18 appendStringInfo calls
Similar to 8461424fd, here we adjust a few new locations which were not using the most suitable appendStringInfo* function for the intended purpose. Author: David Rowley <drowleyml@gmail.com Discussion: https://postgr.es/m/CAApHDvqJnNjueb=Eoj8K+8n0g7nj_AcPWSiCj5RNV4fDejAfqA@mail.gmail.com
Diffstat (limited to 'src/backend/utils/adt/ri_triggers.c')
-rw-r--r--src/backend/utils/adt/ri_triggers.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/backend/utils/adt/ri_triggers.c b/src/backend/utils/adt/ri_triggers.c
index c4ff18ce65e..6239900fa28 100644
--- a/src/backend/utils/adt/ri_triggers.c
+++ b/src/backend/utils/adt/ri_triggers.c
@@ -428,13 +428,13 @@ RI_FKey_check(TriggerData *trigdata)
{
Oid fk_type = RIAttType(fk_rel, riinfo->fk_attnums[riinfo->nkeys - 1]);
- appendStringInfo(&querybuf, ") x1 HAVING ");
+ appendStringInfoString(&querybuf, ") x1 HAVING ");
sprintf(paramname, "$%d", riinfo->nkeys);
ri_GenerateQual(&querybuf, "",
paramname, fk_type,
riinfo->agged_period_contained_by_oper,
"pg_catalog.range_agg", ANYMULTIRANGEOID);
- appendStringInfo(&querybuf, "(x1.r)");
+ appendStringInfoString(&querybuf, "(x1.r)");
}
/* Prepare and save the plan */
@@ -597,13 +597,13 @@ ri_Check_Pk_Match(Relation pk_rel, Relation fk_rel,
{
Oid fk_type = RIAttType(fk_rel, riinfo->fk_attnums[riinfo->nkeys - 1]);
- appendStringInfo(&querybuf, ") x1 HAVING ");
+ appendStringInfoString(&querybuf, ") x1 HAVING ");
sprintf(paramname, "$%d", riinfo->nkeys);
ri_GenerateQual(&querybuf, "",
paramname, fk_type,
riinfo->agged_period_contained_by_oper,
"pg_catalog.range_agg", ANYMULTIRANGEOID);
- appendStringInfo(&querybuf, "(x1.r)");
+ appendStringInfoString(&querybuf, "(x1.r)");
}
/* Prepare and save the plan */
@@ -838,12 +838,12 @@ ri_restrict(TriggerData *trigdata, bool is_no_action)
/* Intersect the fk with the old pk range */
initStringInfo(&intersectbuf);
- appendStringInfoString(&intersectbuf, "(");
+ appendStringInfoChar(&intersectbuf, '(');
ri_GenerateQual(&intersectbuf, "",
attname, fk_period_type,
riinfo->period_intersect_oper,
paramname, pk_period_type);
- appendStringInfoString(&intersectbuf, ")");
+ appendStringInfoChar(&intersectbuf, ')');
/* Find the remaining history */
initStringInfo(&replacementsbuf);