Re: Counting lines correctly in psql help displays - Mailing list pgsql-hackers

From Greg Stark
Subject Re: Counting lines correctly in psql help displays
Date
Msg-id CAM-w4HNv2pajLzOMVBms05+D2bSGm=gDpZHEv6P3y7Lb0hjg3g@mail.gmail.com
Whole thread Raw
In response to Counting lines correctly in psql help displays  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Counting lines correctly in psql help displays  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Sat, Sep 5, 2015 at 5:55 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Ordinarily I might think that was overkill, but given the number of times
> that we've failed to update those counts in the past, I think this is
> definitely a worthwhile investment in maintainability.

So to preface this, this was just a silly hack that turned out to be
more effective and simpler to code than I expected. But I suspect it's
still just a silly idea and easier to do what you suggested. Also, it
seems we often get the count wrong on SQL output and elsewhere anyways
and I'm not sure we really want to make that a strict rule. Also, as
someone who doesn't really like the whole "sometimes you get a pager
sometimes you don't" thing and turns it off whenever he sees it I'm
not in the best place to judge how much work it's worth to get the
line count right.

But that said, here's a tricksy patch that triggers an assertion
failure if the expected_lines is wrong. I intended it to trigger in
the regression tests so it only checks if the pager is actually off.
It wouldn't be hard to make it always check though.

--
greg

Attachment

pgsql-hackers by date:

Previous
From: Tomas Vondra
Date:
Subject: Re: PATCH: index-only scans with partial indexes
Next
From: Merlin Moncure
Date:
Subject: Re: Allow a per-tablespace effective_io_concurrency setting