agora inbox for pgsql-committers@postgresql.org  
help / color / mirror / Atom feed
From: Michael Paquier <michael@paquier.xyz>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: psql: Fix expanded aligned output
Date: Mon, 08 Jun 2026 05:40:37 +0000
Message-ID: <E1wWSiz-001YEY-0W@gemulon.postgresql.org> (raw)

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.stehule@gmail.com>
Reviewed-by: Chao Li <li.evan.chao@gmail.com>
Discussion: https://postgr.es/m/CAFj8pRCzGpsr9zTHbtTd4mGh2YPJqOEgLgt8JLiopuYA9_1xGw@mail.gmail.com
Backpatch-through: 14

Branch
------
REL_14_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/a4ca91ea18916c66fa3539c2fd19d8ba571ce7e8

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(-)



view thread (6+ messages)

Message-ID: <E1wWSiz-001YEY-0W@gemulon.postgresql.org>
Permalink:  ../E1wWSiz-001YEY-0W@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1wWSiz-001YEY-0W@gemulon.postgresql.org

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: michael@paquier.xyz, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: psql: Fix expanded aligned output
  In-Reply-To: <E1wWSiz-001YEY-0W@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox