Re: psql: Activate pager only for height, not width

From: Christoph Berg <myon(at)debian(dot)org>
To: Jeff Janes <jeff(dot)janes(at)gmail(dot)com>
Cc: Brendan Jurd <direvus(at)gmail(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: psql: Activate pager only for height, not width
Date: 2017-05-29 19:30:30
Message-ID: 20170529193030.k3ntdld2its72wvm@msg.df7cb.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Re: Jeff Janes 2017-05-29 <CAMkU=1wBpDrHdjSvABtFRB1TguC+LBJJwpV79kxyMOkeUi2B3Q(at)mail(dot)gmail(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Petr Jelinek 2017-05-29 19:41:26 Re: logical replication busy-waiting on a lock
Previous Message Andres Freund 2017-05-29 19:28:24 Re: logical replication busy-waiting on a lock