paging

From: "A(dot) Van Hook" <hook(at)kcp(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: paging
Date: 2001-03-26 18:04:28
Message-ID: 200103261804.f2QI4cw36474@mail.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

I have a simple script to automate sql statements: q " select * from
tablename" where q is an alias to echo "$@ ; " | psql imdb

Turning on security breaks this script since is need s password.

the new one works a before: q "select *..." passwd where q is now
an expect script:
#!/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.

I can't find any info in the docs. Can some one point me in the
right direction....

thanks

Responses

  • Re: paging at 2001-03-26 18:57:20 from Peter Eisentraut

Browse pgsql-sql by date

  From Date Subject
Next Message Peter Eisentraut 2001-03-26 18:57:20 Re: paging
Previous Message Stephan Szabo 2001-03-26 17:10:50 Re: is it me or trigger side effects