On Wed, 2006-08-09 at 05:31 +0000, tomas@tuxteam.de wrote:
> On Mon, Aug 07, 2006 at 09:40:59PM +0000, PFudd wrote:
> >
> > The following bug has been logged online:
> >
> > Bug reference: 2565
> > Logged by: PFudd
> > Email address: kernel@pkts.ca
> > PostgreSQL version: 8.1.4
> > Operating system: Fedora Core 5
> > Description: pg tool doesn't detect window size changes
> > Details:
>
> [...]
>
> Sorry for my ignorance, but... what is this "pg tool"? (on my system
> there is a pg command, but it is the pager and has'nt anything to do
> with PostgreSQL).
Sorry, I had created an expect script for psql called pg, and forgot I
had done it. Just didn't want to deal with the command line arguments
and the password prompt.
After unsetting the PAGER environment variable (which was 'less') and
not using the expect script, everything works properly. The window size
changes were not being forwarded by expect, and 'more' did a perfect job
with long lines, whereas 'less' did not.
Upon further investigation (as I couldn't believe less would suck at
this) it turns out that the 'r' option in my 'LESS' environment variable
was causing the line wrap breakage (r = show raw escape sequences).
Ok, I've found these solutions: stop using 'expect' and remove the 'r'
from the LESS environment variable.
Next question: can anyone tell me how to automate password logins with
psql?
Thanks!
The old expect script (doesn't pass window change signals):
------
#!/usr/bin/expect -f
set timeout 2
spawn psql -h localhost -U admin -W processdb
match_max 100000
expect -exact "Password for user admin: "
send -- "some password here\r"
expect {
"protein=#" {;}
"FATAL:" {puts "Failure1.";exit 2;}
default {puts "Failure2.";exit 2;}
}
interact
--
PF <kernel@pkts.ca>