Re: paging

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: "A(dot) Van Hook" <hook(at)kcp(dot)com>
Cc: <pgsql-sql(at)postgresql(dot)org>
Subject: Re: paging
Date: 2001-03-26 18:57:20
Message-ID: Pine.LNX.4.30.0103262054390.1114-100000@peter.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

A. Van Hook writes:

> #!/usr/bin/expect
>
> set query [lindex $argv 0]
> set query [lindex $argv 1]
>
> spawn psql imdb -U hook -n
> expect "Password: ";
> send "$passwd\n ";
> expect "imdb=# ";
> send "$query;\r";
> expect "imdb=# ";
> send "\q;\r";
>
> The problem is that long query returns invoke the paging option so you
> can scroll a page a time. Paging doesn't work properly within the
> script and even if it did , I would have to disable it in order to
> redirect the output to a file or a pipe.

Try psql -P pager to turn the pager off. Also you can probably use

export PGPASSWORD=xyz
psql ...

to skip the password probe.

--
Peter Eisentraut peter_e(at)gmx(dot)net http://yi.org/peter-e/

In response to

  • paging at 2001-03-26 18:04:28 from A. Van Hook

Browse pgsql-sql by date

  From Date Subject
Next Message Mathijs Brands 2001-03-26 19:37:43 Re: Calling Java from psql (was Re: requesting help)
Previous Message A. Van Hook 2001-03-26 18:04:28 paging