Re: psql: Count all table footer lines in pager setup

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Erik Wienhold <ewie(at)ewie(dot)name>
Cc: Greg Sabino Mullane <htamfids(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: psql: Count all table footer lines in pager setup
Date: 2025-08-17 15:19:22
Message-ID: 173176.1755443962@sss.pgh.pa.us
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Erik Wienhold <ewie(at)ewie(dot)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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Jelte Fennema-Nio 2025-08-17 17:12:51 Re: [PATCH] GROUP BY ALL
Previous Message Tom Lane 2025-08-17 14:33:46 Re: VM corruption on standby