Re: controlling psql's use of the pager a bit more

Поиск
Список
Период
Сортировка
От Andres Freund
Тема Re: controlling psql's use of the pager a bit more
Дата
Msg-id 20141113161447.GC29112@alap3.anarazel.de
обсуждение исходный текст
Ответ на Re: controlling psql's use of the pager a bit more  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: controlling psql's use of the pager a bit more  (Michael Banck <michael.banck@credativ.de>)
Re: controlling psql's use of the pager a bit more  (Jeff Janes <jeff.janes@gmail.com>)
Список pgsql-hackers
On 2014-11-13 11:09:06 -0500, Tom Lane wrote:
> Andrew Dunstan <andrew@dunslane.net> writes:
> > I often get annoyed because psql is a bit too aggressive when it decides 
> > whether to put output through the pager, and the only way to avoid this 
> > is to turn the pager off (in which case your next query might dump many 
> > thousands of lines to the screen). I'd like a way to be able to specify 
> > a minumum number of lines of output before psql would invoke the pager, 
> > rather than just always using the terminal window size.
> 
> Are you saying you'd want to set the threshold to *more* than the window
> height?  Why?

Not sure what that'd be useful for.

What I've noticed more than once is that it'd be useful to force the
pager if the result is wider than the screen.

> My impression is that the problem is not with the threshold as such,
> it's that psql is not terribly careful about determining how many lines
> it will put out (ie, the value being compared to the threshold isn't
> 100% reliable).  If that's correct, then a hand-set threshold isn't
> really going to make you happier, and what's needed is some hard work
> on improving the quality of the lines-to-be-output estimates.

If it's that, I've personally solved that problem for me by adding -F
(aka --quit-if-one-screen) to $LESS.

Greetings,

Andres Freund

-- Andres Freund                       http://www.2ndQuadrant.com/PostgreSQL Development, 24x7 Support, Training &
Services



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: controlling psql's use of the pager a bit more
Следующее
От: Gilles Darold
Дата:
Сообщение: Segmentation fault in pg_dumpall from master down to 9.1 and other bug introduced by RLS