dbTalk Databases Forums  

[BUGS] BUG #2565: pg tool doesn't detect window size changes

mailing.database.pgsql-bugs mailing.database.pgsql-bugs


Discuss [BUGS] BUG #2565: pg tool doesn't detect window size changes in the mailing.database.pgsql-bugs forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
AT
 
Posts: n/a

Default [BUGS] BUG #2565: pg tool doesn't detect window size changes - 08-08-2006 , 08:35 PM







The following bug has been logged online:

Bug reference: 2565
Logged by: PFudd
Email address: kernel (AT) pkts (DOT) ca
PostgreSQL version: 8.1.4
Operating system: Fedora Core 5
Description: pg tool doesn't detect window size changes
Details:

This is a minor bug, but it would be nice to have fixed.

If you open a terminal window in linux (xterm, rxvt, whatever; I'm using
unicode rxvt), and start pg, you can use it with no problem. However, if
you change the window size while you're in pg, the line wrapping of the
command line messes up. Other programs work correctly (see 'vim').

On a related note, when the results of a select are being displayed on the
screen, showing a page at a time doesn't work right if any rows are longer
than the width of the screen; the first lines scroll off the top. If pg
didn't know the width of the page, this would be acceptable, but as the
command line shows, it *does* know, at least when the program starts.

Thanks for a great system!

---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
choose an index scan if your joining column's datatypes do not
match

Reply With Quote
  #2  
Old   
AT
 
Posts: n/a

Default Re: [BUGS] BUG #2565: pg tool doesn't detect window size changes - 08-08-2006 , 09:06 PM






"PFudd" <kernel (AT) pkts (DOT) ca> writes:
Quote:
If you open a terminal window in linux (xterm, rxvt, whatever; I'm using
unicode rxvt), and start pg, you can use it with no problem. However, if
you change the window size while you're in pg, the line wrapping of the
command line messes up. Other programs work correctly (see 'vim').
This gripe should be directed to the authors of the readline library.

Quote:
On a related note, when the results of a select are being displayed on the
screen, showing a page at a time doesn't work right if any rows are longer
than the width of the screen; the first lines scroll off the top. If pg
didn't know the width of the page, this would be acceptable, but as the
command line shows, it *does* know, at least when the program starts.
.... and this one to the authors of whatever pager you are using.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

http://archives.postgresql.org


Reply With Quote
  #3  
Old   
AT
 
Posts: n/a

Default Re: [BUGS] BUG #2565: pg tool doesn't detect window size changes - 08-09-2006 , 12:38 AM




--4ZLFUWh1odzi/v6L
Content-Type: text/plain; charset=iso-8859-1
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Mon, Aug 07, 2006 at 09:40:59PM +0000, PFudd wrote:
Quote:
=20
The following bug has been logged online:
=20
Bug reference: 2565
Logged by: PFudd
Email address: kernel (AT) pkts (DOT) ca
PostgreSQL version: 8.1.4
Operating system: Fedora Core 5
Description: pg tool doesn't detect window size changes
Details:=20
[...]

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

Thsnks
-- tom=C3=A1s

--4ZLFUWh1odzi/v6L
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: Digital signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)

iD8DBQFE2XMbBcgs9XrR2kYRAvNvAJ9IbWDNl+4g7nV61MzWox wUW9439ACfbz4Y
8UbeeWvQedB8MkwfL8M5fgk=
=rvcf
-----END PGP SIGNATURE-----

--4ZLFUWh1odzi/v6L--



Reply With Quote
  #4  
Old   
AT
 
Posts: n/a

Default Re: [BUGS] BUG #2565: pg tool doesn't detect window size changes - 08-09-2006 , 09:52 PM



On Wed, 2006-08-09 at 05:31 +0000, tomas (AT) tuxteam (DOT) de wrote:
Quote:
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 (AT) pkts (DOT) 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 (AT) pkts (DOT) ca>


---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.