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 <[email protected]>
Reviewed-by: Chao Li <[email protected]>
Discussion: 
https://postgr.es/m/cafj8prczgpsr9zthbttd4mgh2ypjqoeglgt8jliopuya9_1...@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(-)

Reply via email to