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

BharatDB <bharatdbpg@gmail.com>

From: BharatDB <bharatdbpg@gmail.com>
To: Erik Wienhold <ewie@ewie.name>
Cc: Tom Lane <tgl@sss.pgh.pa.us>, Greg Sabino Mullane <htamfids@gmail.com>, pgsql-hackers@postgresql.org
Date: 2025-10-10T07:04:50Z
Lists: pgsql-hackers

Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. Improve psql's ability to select pager mode accurately.

Attachments

Dear Team,

I worked on the pager issue in print.c and made the following updates:

   -

   Added a linecount() helper to correctly count all lines, including
   footers.
   -

   In IsPagerNeeded , replaced the old logic lines++ with lines +=
   linecount(f->data).

With this fix, the pager now triggers correctly for long outputs.
Please let me know if this way of fixing looks good, or if you have any
suggestions for improvement.

Best regards,
[lakshmi G]

On Wed, Oct 8, 2025 at 2:40 PM Erik Wienhold <ewie@ewie.name> wrote:

> On 2025-10-07 17:01 +0200, Tom Lane wrote:
> > Pushed, after a tiny bit more comment-burnishing.
>
> Thank you for the extensive rework.
>
> --
> Erik Wienhold
>
>
>