Re: psql: \pset pager 'always'?

Lists: pgsql-general
From: Antti Haapala <antti(dot)haapala(at)iki(dot)fi>
To: pgsql-general(at)postgresql(dot)org
Subject: psql: \pset pager 'always'?
Date: 2002-09-11 14:14:22
Message-ID: Pine.GSO.4.44.0209101817330.15658-100000@paju.oulu.fi
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general


I don't know if this is already done, but...

I'm really annoyed by that little 'feature' of psql that decides whether
to use pager or not. I personally use GNU 'less' with options -S -F as my
pager, which allows me to scroll vertically AS WELL AS horizontally on
long input. So a "use pager always" option with no strange automagic
behaviour would be nice. Or do you consider this being readable (copyed
verbatim from terminal window):

template1=# select * from pg_class limit 1;
relname | reltype | relowner | relam | relfilenode | relpages | reltuples |
reltoastrelid | reltoastidxid | relhasindex | relisshared | relkind |
relnatts | relchecks | reltriggers | relukeys | relfkeys | relrefs |
relhasoids | relhaspkey | relhasrules | relhassubclass | relacl
----------------------+---------+----------+-------+-------------+----------+-----------+---------------+---------------+-------------+-------------+---------+----------+-----------+-------------+----------+----------+---------+------------+------------+-
------------+----------------+--------

pg_type | 71 | 1 | 0 | 1247 |
2 |
143 | 0 | 0 | t | f
| r |
17 | 0 | 0 | 0 | 0 | 0
| t

Until that I need to avoid queries with too _few_ resulting rows in psql.
;-) (select * from pg_class works brilliantly).

--
Antti Haapala


From: Justin Hawkins <justin(at)internode(dot)com(dot)au>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: psql: \pset pager 'always'?
Date: 2002-09-12 00:50:45
Message-ID: 87lm68do9m.fsf@weasel.internode.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

antti(dot)haapala(at)iki(dot)fi (Antti Haapala) writes:

> I don't know if this is already done, but...
>
> I'm really annoyed by that little 'feature' of psql that decides whether
> to use pager or not. I personally use GNU 'less' with options -S -F as my
> pager, which allows me to scroll vertically AS WELL AS horizontally on
> long input. So a "use pager always" option with no strange automagic
> behaviour would be nice. Or do you consider this being readable (copyed
> verbatim from terminal window):

Yes, I'd like to second that.

My ugly workaround when I need to have less invoked (so I can scroll
sideways) and the result set it small (in rows), I make my window very
small (vertically), run the query, then stretch it out again.

- Justin

--
Justin Hawkins
Internode Professional Access


From: Martijn van Oosterhout <kleptog(at)svana(dot)org>
To: Justin Hawkins <justin(at)internode(dot)com(dot)au>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: psql: \pset pager 'always'?
Date: 2002-09-16 14:30:00
Message-ID: 20020917003000.A17195@svana.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

On Thu, Sep 12, 2002 at 10:20:45AM +0930, Justin Hawkins wrote:
> antti(dot)haapala(at)iki(dot)fi (Antti Haapala) writes:
>
> > I don't know if this is already done, but...
> >
> > I'm really annoyed by that little 'feature' of psql that decides whether
> > to use pager or not. I personally use GNU 'less' with options -S -F as my
> > pager, which allows me to scroll vertically AS WELL AS horizontally on
> > long input. So a "use pager always" option with no strange automagic
> > behaviour would be nice. Or do you consider this being readable (copyed
> > verbatim from terminal window):
>
> Yes, I'd like to second that.
>
> My ugly workaround when I need to have less invoked (so I can scroll
> sideways) and the result set it small (in rows), I make my window very
> small (vertically), run the query, then stretch it out again.

Remember, you can always use \g like this:

select * from table \g |less -S

Maybe not neat, but very effective.
--
Martijn van Oosterhout <kleptog(at)svana(dot)org> http://svana.org/kleptog/
> There are 10 kinds of people in the world, those that can do binary
> arithmetic and those that can't.


From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Martijn van Oosterhout <kleptog(at)svana(dot)org>
Cc: Justin Hawkins <justin(at)internode(dot)com(dot)au>, pgsql-general(at)postgresql(dot)org
Subject: Re: psql: \pset pager 'always'?
Date: 2002-09-16 18:03:41
Message-ID: 200209161803.g8GI3fL27371@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general


Can someone supply a patch to automatically invoke the pager if the
output width is greater than the screen? We already test for screen
rows but not for screen width.

---------------------------------------------------------------------------

Martijn van Oosterhout wrote:
> On Thu, Sep 12, 2002 at 10:20:45AM +0930, Justin Hawkins wrote:
> > antti(dot)haapala(at)iki(dot)fi (Antti Haapala) writes:
> >
> > > I don't know if this is already done, but...
> > >
> > > I'm really annoyed by that little 'feature' of psql that decides whether
> > > to use pager or not. I personally use GNU 'less' with options -S -F as my
> > > pager, which allows me to scroll vertically AS WELL AS horizontally on
> > > long input. So a "use pager always" option with no strange automagic
> > > behaviour would be nice. Or do you consider this being readable (copyed
> > > verbatim from terminal window):
> >
> > Yes, I'd like to second that.
> >
> > My ugly workaround when I need to have less invoked (so I can scroll
> > sideways) and the result set it small (in rows), I make my window very
> > small (vertically), run the query, then stretch it out again.
>
> Remember, you can always use \g like this:
>
> select * from table \g |less -S
>
> Maybe not neat, but very effective.
> --
> Martijn van Oosterhout <kleptog(at)svana(dot)org> http://svana.org/kleptog/
> > There are 10 kinds of people in the world, those that can do binary
> > arithmetic and those that can't.
>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: Have you searched our list archives?
>
> http://archives.postgresql.org
>

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073