agora inbox for pgsql-committers@postgresql.orghelp / color / mirror / Atom feed
pgsql: Fix psql's pager selection for wrapped expanded output. 2+ messages / 1 participants [nested] [flat]
* pgsql: Fix psql's pager selection for wrapped expanded output. @ 2026-07-05 22:11 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 2+ messages in thread From: Tom Lane @ 2026-07-05 22:11 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Fix psql's pager selection for wrapped expanded output. psql decided whether to use the pager in expanded output without accounting for possible wrapping of column values. This could allow it to not use the pager in cases where it should do so. To fix, move the IsPagerNeeded decision in print_aligned_vertical() down until after the wrapped data width is known. Then, if we're in wrapped mode, prepare a width_wrap array specifying that width (which, in vertical mode, is the same for all columns). This is fixing an omission in 27da1a796, so back-patch to v19 where that came in. Author: Chao Li <li.evan.chao@gmail.com> Reviewed-by: Erik Wienhold <ewie@ewie.name> Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us> Discussion: https://postgr.es/m/A44110E7-6A03-4C67-95AD-527192A6C768@gmail.com Backpatch-through: 19 Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/07abbc93ba5ba41b60927221db92bc73f75fd1ba Modified Files -------------- src/bin/psql/t/030_pager.pl | 5 +++++ src/fe_utils/print.c | 53 ++++++++++++++++++++++++++++++--------------- 2 files changed, 40 insertions(+), 18 deletions(-) ^ permalink raw reply [nested|flat] 2+ messages in thread
* pgsql: Fix psql's pager selection for wrapped expanded output. @ 2026-07-05 22:11 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 2+ messages in thread From: Tom Lane @ 2026-07-05 22:11 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Fix psql's pager selection for wrapped expanded output. psql decided whether to use the pager in expanded output without accounting for possible wrapping of column values. This could allow it to not use the pager in cases where it should do so. To fix, move the IsPagerNeeded decision in print_aligned_vertical() down until after the wrapped data width is known. Then, if we're in wrapped mode, prepare a width_wrap array specifying that width (which, in vertical mode, is the same for all columns). This is fixing an omission in 27da1a796, so back-patch to v19 where that came in. Author: Chao Li <li.evan.chao@gmail.com> Reviewed-by: Erik Wienhold <ewie@ewie.name> Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us> Discussion: https://postgr.es/m/A44110E7-6A03-4C67-95AD-527192A6C768@gmail.com Backpatch-through: 19 Branch ------ REL_19_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/56e892a49439ad361d8610bd859f4c7a29ec336e Modified Files -------------- src/bin/psql/t/030_pager.pl | 5 +++++ src/fe_utils/print.c | 53 ++++++++++++++++++++++++++++++--------------- 2 files changed, 40 insertions(+), 18 deletions(-) ^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2026-07-05 22:11 UTC | newest] Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2026-07-05 22:11 pgsql: Fix psql's pager selection for wrapped expanded output. Tom Lane <tgl@sss.pgh.pa.us> 2026-07-05 22:11 pgsql: Fix psql's pager selection for wrapped expanded output. Tom Lane <tgl@sss.pgh.pa.us>
This inbox is served by agora; see mirroring instructions for how to clone and mirror all data and code used for this inbox