Re: [HACKERS] psql: Activate pager only for height, not width - Mailing list pgsql-hackers

From Christoph Berg
Subject Re: [HACKERS] psql: Activate pager only for height, not width
Date
Msg-id 20170529193030.k3ntdld2its72wvm@msg.df7cb.de
Whole thread Raw
In response to Re: [HACKERS] psql: Activate pager only for height, not width  (Jeff Janes <jeff.janes@gmail.com>)
Responses Re: [HACKERS] psql: Activate pager only for height, not width  (Brendan Jurd <direvus@gmail.com>)
List pgsql-hackers
Re: Jeff Janes 2017-05-29 <CAMkU=1wBpDrHdjSvABtFRB1TguC+LBJJwpV79kxyMOkeUi2B3Q@mail.gmail.com>
> > Usually I turn the pager off completely, and only switch it on when I am
> > about to execute something that will return many rows, but what I'd really
> > like is some way to tell psql to activate the pager as normal for height,
> > but to ignore width.  My first thought was an alternate mode to \pset pager
> > -- to {'on' | 'off' | 'always'} we could add 'height'.

This bugs me pretty often as well. Height seems to be a more sensible
trigger; maybe not by default, but I could imagine setting that as
default in my .psqlrc.

> > Another option is to add the ability to specify the number of columns
> > which psql considers "too wide", analogous to pager_min_lines.  I could
> > then set pager_min_cols to something around 150 which would work nicely for
> > my situation.

Oh interesting, I didn't know about pager_min_lines. That sounds
useful as well. +1 on the analogous pager_min_cols option.

> (You can configure the pager not to redraw the screen when exited, but I
> want it to redraw the screen after looking at 10,000 rows, just not after
> looking ten rows, one of which was 170 characters wide)

Another thing you can do which has somewhat solved the above issue for
me is PAGER="less -S" which tells less not to wrap lines but let the 
user scroll left/right using the arrow keys.

Christoph



pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: [HACKERS] logical replication busy-waiting on a lock
Next
From: Petr Jelinek
Date:
Subject: Re: [HACKERS] logical replication busy-waiting on a lock