pgsql: psql: Fix expanded aligned output

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: psql: Fix expanded aligned output
Date: 2026-06-08 05:40:37
Message-ID: E1wWSiz-001YEV-0S@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

psql: Fix expanded aligned output

When a table's columns are narrower than the record header line, the
expanded aligned format produced misaligned output because the data
column width was not adjusted to match the record header width, leading
to output like:
+-[ RECORD 1 ]-+
| a | 10 |
| b | 20 |
+---+----+

This commit adjusts the output so as the column width match with the
header line, giving:
+-[ RECORD 1 ]-+
| a | 10 |
| b | 20 |
+---+----------+

Author: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
Reviewed-by: Chao Li <li(dot)evan(dot)chao(at)gmail(dot)com>
Discussion: https://postgr.es/m/CAFj8pRCzGpsr9zTHbtTd4mGh2YPJqOEgLgt8JLiopuYA9_1xGw@mail.gmail.com
Backpatch-through: 14

Branch
------
REL_15_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/022ba5c61412765d6aa3792b4dcfadc1ccbd72d3

Modified Files
--------------
src/fe_utils/print.c | 7 ++++---
src/test/regress/expected/psql.out | 26 ++++++++++++++++++++++++++
src/test/regress/sql/psql.sql | 11 +++++++++++
3 files changed, 41 insertions(+), 3 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Amit Kapila 2026-06-08 06:02:34 pgsql: Doc: Add missing SGML markup in alter_publication.sgml.
Previous Message Amit Kapila 2026-06-08 05:37:23 pgsql: Fix publisher retain_dead_tuples check when also changing origin