]> git.ipfire.org Git - thirdparty/postgresql.git/commit
psql: Fix expanded aligned output
authorMichael Paquier <michael@paquier.xyz>
Mon, 8 Jun 2026 05:38:01 +0000 (14:38 +0900)
committerMichael Paquier <michael@paquier.xyz>
Mon, 8 Jun 2026 05:38:01 +0000 (14:38 +0900)
commita4ca91ea18916c66fa3539c2fd19d8ba571ce7e8
tree22f2d0cef1028b33d9d751d291de0ebff8ece8c2
parent1eda3eb0753ac6c788c11830e9abc0821f7afd48
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
src/fe_utils/print.c
src/test/regress/expected/psql.out
src/test/regress/sql/psql.sql