Re: psql: Count all table footer lines in pager setup - Mailing list pgsql-hackers

From Tom Lane
Subject Re: psql: Count all table footer lines in pager setup
Date
Msg-id 173176.1755443962@sss.pgh.pa.us
Whole thread Raw
In response to Re: psql: Count all table footer lines in pager setup  (Erik Wienhold <ewie@ewie.name>)
List pgsql-hackers
Erik Wienhold <ewie@ewie.name> writes:
> On 2025-08-11 20:28 +0200, Greg Sabino Mullane wrote:
>> Patch looks good, applies and works. Needs a pgindent run:

> Thanks for the review.  Here's v2 with proper formatting.

This appears to fix the problem it sets out to fix, but it looks
to me like there are adjacent problems of the same ilk; do you
feel like looking at those?

Specifically, I wondered whether we had the same bug with table
headers or cells that contain newlines.  It looks like
print_aligned_text() is okay, because it counts up those newlines
and includes them in the extra_output_lines value that it passes
to IsPagerNeeded().  But print_aligned_vertical() and printTable()
have no such logic.  Am I missing something about why those cases
need not consider this issue?  If not, can we fix that by moving
all the "extra_lines" logic into IsPagerNeeded(), and if not
what shall we do about it?

            regards, tom lane



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: VM corruption on standby
Next
From: Jelte Fennema-Nio
Date:
Subject: Re: [PATCH] GROUP BY ALL