Skip site navigation (1) Skip section navigation (2)

Re: [HACKERS] psql \h alter scrolls of screen

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Robert Treat <xzilla(at)users(dot)sourceforge(dot)net>,PostgreSQL-patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: [HACKERS] psql \h alter scrolls of screen
Date: 2003-09-10 22:21:39
Message-ID: 200309102221.h8AMLdV29649@candle.pha.pa.us (view raw or flat)
Thread:
Lists: pgsql-hackerspgsql-patches
Tom Lane wrote:
> Robert Treat <xzilla(at)users(dot)sourceforge(dot)net> writes:
> > On Thu, 2003-09-04 at 21:14, Bruce Momjian wrote:
> >> Should we be using the pager for \h output?
> 
> > in 7.3.4 we do, let me check 7.4...seems to work, though I am on beta1
> > on this box.
> 
> Hmm.  I do not see the pager used for \h in either version, though it
> does get used for \? ...

OK, turns out the '\h alter' code does a simple printf(), not a
PageOutput() and fprintf() to that pipe.  Various \h outputs are long,
including CREATE TABLE, GRANT, and ALTER TABLE.  ALTER itself is really
larger because it prints all the ALTER commands help.

The attached patch counts the number of newlines output by \h command,
and invokes the pager where appropriate.

This isn't a bug fix, so it will be kept for 7.5.

-- 
  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

In response to

Responses

pgsql-hackers by date

Next:From: Alvaro HerreraDate: 2003-09-10 22:24:47
Subject: Dropping users
Previous:From: Jon JensenDate: 2003-09-10 22:12:57
Subject: Re: massive quotes?

pgsql-patches by date

Next:From: Jon JensenDate: 2003-09-11 00:24:53
Subject: pg_hba.conf patch for hostnossl
Previous:From: Bruce MomjianDate: 2003-09-10 20:10:14
Subject: Re: fix doc typo

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group