Re: Proposed patch - psql wraps at window width - Mailing list pgsql-hackers

From Gregory Stark
Subject Re: Proposed patch - psql wraps at window width
Date
Msg-id 87tzhs7x0k.fsf@oxford.xeocode.com
Whole thread Raw
In response to Re: Proposed patch - psql wraps at window width  (Bruce Momjian <bruce@momjian.us>)
Responses Re: Proposed patch - psql wraps at window width  (Bruce Momjian <bruce@momjian.us>)
List pgsql-hackers
"Bruce Momjian" <bruce@momjian.us> writes:

> Brendan Jurd wrote:
>> To me, this message sounds like you're setting the width of a single
>> column, when in fact you're setting the target *total* width of the
>> table.  I think this message would be more clear if it read "Target
>> output width ..." or "Target table width ...".  Also, as far as the
>> user is concerned the format is referred to as  "wrapped", not "wrap".
>
> Good point.  I have updated the text to be:
>
>     test=> \pset columns 70
>     Target width of file and pipe output for "wrap" format is 70.

I think "file and pipe output" is short-sighted. There are lots more cases
this is necessary including SSH sessions and emacs shell buffers, etc. And as
I pointed out there are often cases where the user may want to override the
terminal width in any case.

Earlier I suggested -- and nobody refuted -- that we should follow the
precedents of ls and man and other tools which need to find the terminal
width: Explicitly set width takes precedence always, if it's not explicitly
set then you use the ioctl, and if that fails then you use the COLUMNS
environment variable.

--  Gregory Stark EnterpriseDB          http://www.enterprisedb.com Ask me about EnterpriseDB's 24x7 Postgres support!


pgsql-hackers by date:

Previous
From: Ron Mayer
Date:
Subject: Re: Index AM change proposals, redux
Next
From: Ron Mayer
Date:
Subject: Re: Per-table random_page_cost for tables that we know are always cached