pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
possible bug in psql
5+ messages / 4 participants
[nested] [flat]

* possible bug in psql
@ 2012-05-29 03:11 chester c young <chestercyoung@yahoo.com>
  2012-05-29 03:34 ` Re: possible bug in psql Tom Lane <tgl@sss.pgh.pa.us>
  2012-05-29 11:48 ` Re: possible bug in psql Jasen Betts <jasen@xnet.co.nz>
  0 siblings, 2 replies; 5+ messages in thread

From: chester c young @ 2012-05-29 03:11 UTC (permalink / raw)
  To: pgsql-sql

do not know if right mailing list

in psql in Ubuntu, when beginning with a smaller terminal, eg, 80 col wide, then moving to a larger terminal, eg, 132 col wide, the readline(?) editor in psql still treats like 80 cols, making it impossible to edit longer text.




^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: possible bug in psql
  2012-05-29 03:11 possible bug in psql chester c young <chestercyoung@yahoo.com>
@ 2012-05-29 03:34 ` Tom Lane <tgl@sss.pgh.pa.us>
  1 sibling, 0 replies; 5+ messages in thread

From: Tom Lane @ 2012-05-29 03:34 UTC (permalink / raw)
  To: chester c young <chestercyoung@yahoo.com>; +Cc: pgsql-sql

chester c young <chestercyoung@yahoo.com> writes:
> do not know if right mailing list
> in psql in Ubuntu, when beginning with a smaller terminal, eg, 80 col wide, then moving to a larger terminal, eg, 132 col wide, the readline(?) editor in psql still treats like 80 cols, making it impossible to edit longer text.

You'd need to tell the readline people about that one.

			regards, tom lane



^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: possible bug in psql
  2012-05-29 03:11 possible bug in psql chester c young <chestercyoung@yahoo.com>
@ 2012-05-29 11:48 ` Jasen Betts <jasen@xnet.co.nz>
  2012-05-30 01:13   ` Re: possible bug in psql Craig Ringer <ringerc@ringerc.id.au>
  1 sibling, 1 reply; 5+ messages in thread

From: Jasen Betts @ 2012-05-29 11:48 UTC (permalink / raw)
  To: pgsql-sql

On 2012-05-29, chester c young <chestercyoung@yahoo.com> wrote:
> do not know if right mailing list
>
> in psql in Ubuntu, when beginning with a smaller terminal, eg, 80
> col wide, then moving to a larger terminal, eg, 132 col wide, the
> readline(?) editor in psql still treats like 80 cols, making it
> impossible to edit longer text.    

As far as I know (as this is the behavior in debian stable)
the ubuntu people use libgettext and not libreadline.

You can force it to use libreadline by using LD_PRELOAD.  I reccomend 
that you do I did this by editing /usr/bin/psql which is a perl script

In any case linux doesn't propogate SIG_WINCH to the other processes
that are using the pty so even if you are using readline you have to 
force this by resizing the window again after exiting the pager, and
then press ctrl-l to clear the screen. 

see also: ld.so(8) kill(7) /usr/share/doc/postgresql-common/*
-- 
⚂⚃ 100% natura




^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: possible bug in psql
  2012-05-29 03:11 possible bug in psql chester c young <chestercyoung@yahoo.com>
  2012-05-29 11:48 ` Re: possible bug in psql Jasen Betts <jasen@xnet.co.nz>
@ 2012-05-30 01:13   ` Craig Ringer <ringerc@ringerc.id.au>
  0 siblings, 0 replies; 5+ messages in thread

From: Craig Ringer @ 2012-05-30 01:13 UTC (permalink / raw)
  To: Jasen Betts <jasen@xnet.co.nz>; +Cc: pgsql-sql

On 05/29/2012 07:48 PM, Jasen Betts wrote:
> On 2012-05-29, chester c young<chestercyoung@yahoo.com>  wrote:
>> do not know if right mailing list
>>
>> in psql in Ubuntu, when beginning with a smaller terminal, eg, 80
>> col wide, then moving to a larger terminal, eg, 132 col wide, the
>> readline(?) editor in psql still treats like 80 cols, making it
>> impossible to edit longer text.
> As far as I know (as this is the behavior in debian stable)
> the ubuntu people use libgettext and not libreadline.
>
> You can force it to use libreadline by using LD_PRELOAD.  I reccomend
> that you do I did this by editing /usr/bin/psql which is a perl script
>
> In any case linux doesn't propogate SIG_WINCH to the other processes
> that are using the pty so even if you are using readline you have to
> force this by resizing the window again after exiting the pager, and
> then press ctrl-l to clear the screen.
It'd be nice if `less` would kill(SIGWINCH) its ppid since it is so 
often invoked as a helper. I guess they probably have good reasons not to.

--
Craig Ringer



^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: possible bug in psql
@ 2012-05-30 03:33 chester c young <chestercyoung@yahoo.com>
  0 siblings, 0 replies; 5+ messages in thread

From: chester c young @ 2012-05-30 03:33 UTC (permalink / raw)
  To: Jasen Betts <jasen@xnet.co.nz>; pgsql-sql

> > do not know if right mailing list
> >
> > in psql in Ubuntu, when beginning with a smaller
> terminal, eg, 80
> > col wide, then moving to a larger terminal, eg, 132 col
> wide, the
> > readline(?) editor in psql still treats like 80 cols,
> making it
> > impossible to edit longer text.    
> 
> As far as I know (as this is the behavior in debian stable)
> the ubuntu people use libgettext and not libreadline.
> 
> You can force it to use libreadline by using
> LD_PRELOAD.  I reccomend 
> that you do I did this by editing /usr/bin/psql which is a
> perl script
> 
> In any case linux doesn't propogate SIG_WINCH to the other
> processes
> that are using the pty so even if you are using readline you
> have to 
> force this by resizing the window again after exiting the
> pager, and
> then press ctrl-l to clear the screen. 

seems to me that Ubuntu is using readline (but I might be wrong)

from /usr/bin/psql:

# libreadline is a lot better than libedit, so prefer that
if ($cmdname eq 'psql') {
    my @readlines;
    push @readlines, sort(</lib/libreadline.so.*>);
    if (@readlines) {
    $ENV{'LD_PRELOAD'} = ($ENV{'LD_PRELOAD'} or '') . ':' . $readlines[-1];
    }
}

also, LD_PRELOAD is not referenced anywhere in /etc/postgrest/...



^ permalink  raw  reply  [nested|flat] 5+ messages in thread


end of thread, other threads:[~2012-05-30 03:33 UTC | newest]

Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2012-05-29 03:11 possible bug in psql chester c young <chestercyoung@yahoo.com>
2012-05-29 03:34 ` Tom Lane <tgl@sss.pgh.pa.us>
2012-05-29 11:48 ` Jasen Betts <jasen@xnet.co.nz>
2012-05-30 01:13   ` Craig Ringer <ringerc@ringerc.id.au>
2012-05-30 03:33 Re: possible bug in psql chester c young <chestercyoung@yahoo.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox