Re: [HACKERS] Counting lines correctly in psql help displays

2015-09-09 Thread Tom Lane
Andrew Dunstan writes: > On 09/05/2015 12:55 PM, Tom Lane wrote: >> Or we could just give up and replace the counts by INT_MAX, forcing use >> of the pager unless you've turned it off. All of those outputs are long >> enough now that it's hard to believe there are any common

Re: [HACKERS] Counting lines correctly in psql help displays

2015-09-09 Thread Andrew Dunstan
On 09/09/2015 10:27 AM, Tom Lane wrote: Andrew Dunstan writes: On 09/05/2015 12:55 PM, Tom Lane wrote: Or we could just give up and replace the counts by INT_MAX, forcing use of the pager unless you've turned it off. All of those outputs are long enough now that it's

Re: [HACKERS] Counting lines correctly in psql help displays

2015-09-08 Thread Jim Nasby
On 9/5/15 3:50 PM, Tom Lane wrote: Greg Stark writes: 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

Re: [HACKERS] Counting lines correctly in psql help displays

2015-09-08 Thread Tom Lane
Jim Nasby writes: > On 9/5/15 3:50 PM, Tom Lane wrote: >> Greg Stark writes: >>> But that said, here's a tricksy patch that triggers an assertion >>> failure if the expected_lines is wrong. >> Hmm ... that would put a premium on the linecount always

Re: [HACKERS] Counting lines correctly in psql help displays

2015-09-08 Thread Andrew Dunstan
On 09/05/2015 12:55 PM, Tom Lane wrote: I wrote: BTW, I noticed that the PageOutput line counts for psql's usage(), slashUsage(), and helpVariables() were all three wrong, which I'm afraid has been their usual state in the past too. Since commit 07c8651dd91d5aea there's been a pretty easy

Re: [HACKERS] Counting lines correctly in psql help displays

2015-09-05 Thread Greg Stark
On Sat, Sep 5, 2015 at 5:55 PM, Tom Lane 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,

Re: [HACKERS] Counting lines correctly in psql help displays

2015-09-05 Thread Tom Lane
Greg Stark writes: > 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.