From ad7af66345cf21febfa041e121a1fb56e3361c3f Mon Sep 17 00:00:00 2001 From: Robert Haas Date: Fri, 27 Jun 2025 10:39:40 -0400 Subject: [PATCH] Move wrap_column into pgpa_output_context --- contrib/pg_plan_advice/pgpa_output.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) 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); } } -- 2.39.5