Hi

There is a bug in fe_utils

(2026-03-23 20:36:21) postgres=# \pset
border                   2
columns                  0
csv_fieldsep             ','
display_false            'f'
display_true             't'
expanded                 on
fieldsep                 '|'
fieldsep_zero            off
footer                   on
format                   aligned
linestyle                unicode
null                     '∅'
numericlocale            off
pager                    1
pager_min_lines          0
recordsep                '\n'
recordsep_zero           off
tableattr
title
tuples_only              off
unicode_border_linestyle single
unicode_column_linestyle single
unicode_header_linestyle double
xheader_width            full

(2026-03-23 20:36:56) postgres=# select * from foo;
kuku
┌────┬────┐
│ a  │ b  │
╞════╪════╡
│ 10 │ 20 │
│ 10 │ 20 │
└────┴────┘
(2 rows)

(2026-03-23 20:36:58) postgres=# \x
Expanded display is on.
(2026-03-23 20:37:01) postgres=# select * from foo;
┌─[ RECORD 1 ]─┐
│ a │ 10 │
│ b │ 20 │
╞═[ RECORD 2 ]═╡
│ a │ 10 │
│ b │ 20 │
└───┴────┘

the bugfix is really short

pavel@nemesis:~/src/postgresql$ git diff master
diff --git a/src/fe_utils/print.c b/src/fe_utils/print.c
index 12d969e8666..58a04a902d5 100644
--- a/src/fe_utils/print.c
+++ b/src/fe_utils/print.c
@@ -1445,7 +1445,7 @@ print_aligned_vertical(const printTableContent *cont,
    /*
     * Calculate available width for data in wrapped mode
     */
-   if (cont->opt->format == PRINT_WRAPPED)
+   if (cont->opt->format == PRINT_WRAPPED || cont->opt->format ==
PRINT_ALIGNED)
    {
        unsigned int swidth,
                    rwidth = 0,

after fix:

(2026-03-23 20:40:11) postgres=# \x
Expanded display is on.
(2026-03-23 20:40:13) postgres=# select * from foo;
┌─[ RECORD 1 ]─┐
│ a │ 10       │
│ b │ 20       │
╞═[ RECORD 2 ]═╡
│ a │ 10       │
│ b │ 20       │
└───┴──────────┘

Regards

Pavel
From 131261620f35997be1cf2b4726577c2c284335d2 Mon Sep 17 00:00:00 2001
From: "[email protected]" <[email protected]>
Date: Mon, 23 Mar 2026 20:39:31 +0100
Subject: [PATCH] fix expended aligned format

---
 src/fe_utils/print.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/fe_utils/print.c b/src/fe_utils/print.c
index 12d969e8666..58a04a902d5 100644
--- a/src/fe_utils/print.c
+++ b/src/fe_utils/print.c
@@ -1445,7 +1445,7 @@ print_aligned_vertical(const printTableContent *cont,
 	/*
 	 * Calculate available width for data in wrapped mode
 	 */
-	if (cont->opt->format == PRINT_WRAPPED)
+	if (cont->opt->format == PRINT_WRAPPED || cont->opt->format == PRINT_ALIGNED)
 	{
 		unsigned int swidth,
 					rwidth = 0,
-- 
2.53.0

Reply via email to