From: Robert Haas Date: Fri, 27 Jun 2025 14:39:40 +0000 (-0400) Subject: Move wrap_column into pgpa_output_context X-Git-Url: http://git.postgresql.org/gitweb/static/main.js?a=commitdiff_plain;h=ad7af66345cf21febfa041e121a1fb56e3361c3f;p=users%2Frhaas%2Fpostgres.git Move wrap_column into pgpa_output_context --- diff --git a/contrib/pg_plan_advice/pgpa_output.c b/contrib/pg_plan_advice/pgpa_output.c index 2c101090a6..8491ce6c6e 100644 --- a/contrib/pg_plan_advice/pgpa_output.c +++ b/contrib/pg_plan_advice/pgpa_output.c @@ -18,6 +18,7 @@ typedef struct pgpa_output_context { const char **rt_identifiers; StringInfo buf; + int wrap_column; } pgpa_output_context; static void pgpa_debug_out_clumped_join(pgpa_output_context *context, @@ -44,6 +45,7 @@ pgpa_output_advice(StringInfo buf, pgpa_plan_walker_context *walker, context.rt_identifiers = rt_identifiers; context.buf = buf; + context.wrap_column = 79; /* XXX */ foreach(lc, walker->unrolled_joins) { @@ -97,7 +99,7 @@ pgpa_debug_out_clumped_join(pgpa_output_context *context, } else { - pgpa_maybe_linebreak(context->buf, 79); + pgpa_maybe_linebreak(context->buf, context->wrap_column); appendStringInfo(context->buf, " %s", identifier); } } @@ -119,11 +121,11 @@ pgpa_debug_out_unrolled_join(pgpa_output_context *context, { char *cstrategy; - pgpa_maybe_linebreak(context->buf, 79); + pgpa_maybe_linebreak(context->buf, context->wrap_column); cstrategy = pgpa_cstring_join_strategy(join->strategy[k]); appendStringInfo(context->buf, " %s", cstrategy); - pgpa_maybe_linebreak(context->buf, 79); + pgpa_maybe_linebreak(context->buf, context->wrap_column); appendStringInfoChar(context->buf, ' '); pgpa_debug_out_join_member(context, &join->inner[k]); } @@ -160,7 +162,7 @@ pgpa_debug_out_gathered_join(pgpa_output_context *context, } else { - pgpa_maybe_linebreak(context->buf, 79); + pgpa_maybe_linebreak(context->buf, context->wrap_column); appendStringInfo(context->buf, " %s", identifier); } }