public inbox for [email protected]  
help / color / mirror / Atom feed
From: Chao Li <[email protected]>
To: Pavel Stehule <[email protected]>
Cc: PostgreSQL Hackers <[email protected]>
Subject: Re: bugfix - fix broken output in expanded aligned format, when data are too short
Date: Tue, 24 Mar 2026 14:12:18 +0800
Message-ID: <[email protected]> (raw)
In-Reply-To: <CAFj8pRAf1jYo8Nfz=sbfpMfaUBDsb77qGxdR+8JBxTH3_6MnBw@mail.gmail.com>
References: <CAFj8pRCzGpsr9zTHbtTd4mGh2YPJqOEgLgt8JLiopuYA9_1xGw@mail.gmail.com>
	<CAFj8pRAf1jYo8Nfz=sbfpMfaUBDsb77qGxdR+8JBxTH3_6MnBw@mail.gmail.com>



> On Mar 24, 2026, at 13:46, Pavel Stehule <[email protected]> wrote:
> 
> Hi
> 
> new version
> 
> * fixed unwanted forcing to wrapped mode
> * regress test
> 
> Regards
> 
> Pavel
> <v20260324-1-0001-The-output-of-thin-table-is-broken-in-expanded-mode-.patch>

Thanks for the fix. The patch overall looks good to me. A couple of small comments:

1
```
 	/*
 	 * 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)
```

Since the condition has been updated, I think the comment above should be adjusted as well.

2
```
+-- the output in expanded mode is shorter than header
+\pset border 2
+\pset expanded on
+create table psql_short_tab(a int, b int);
+insert into psql_short_tab values(10,20),(30,40);
+\pset format aligned
+select * from psql_short_tab;
+\pset format wrapped
+select * from psql_short_tab;
+drop table psql_short_tab;
+
```

After this test, does it make sense to turn expanded mode off explicitly, in case it affects following tests? Today the next test happens to reset it, but maybe tomorrow a new test gets added before that point.

Best regards,
--
Chao Li (Evan)
HighGo Software Co., Ltd.
https://www.highgo.com/









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: [email protected]
  Cc: [email protected], [email protected], [email protected]
  Subject: Re: bugfix - fix broken output in expanded aligned format, when data are too short
  In-Reply-To: <[email protected]>

* 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