Re: paging - Mailing list pgsql-sql

From Peter Eisentraut
Subject Re: paging
Date
Msg-id Pine.LNX.4.30.0103262054390.1114-100000@peter.localdomain
Whole thread Raw
In response to paging  ("A. Van Hook" <hook@kcp.com>)
List 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@gmx.net       http://yi.org/peter-e/



pgsql-sql by date:

Previous
From: "A. Van Hook"
Date:
Subject: paging
Next
From: Peter Eisentraut
Date:
Subject: Re: Calling Java from psql (was Re: requesting help)