Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 8AFE52E016E for ; Mon, 3 Mar 2008 15:29:16 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 89134-05 for ; Mon, 3 Mar 2008 15:29:11 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from outA.internet-mail-service.net (outA.internet-mail-service.net [216.240.47.224]) by postgresql.org (Postfix) with ESMTP id 932A12E0275 for ; Mon, 3 Mar 2008 15:29:11 -0400 (AST) Received: from mx0.idiom.com (HELO idiom.com) (216.240.32.160) by out.internet-mail-service.net (qpsmtpd/0.40) with ESMTP; Mon, 03 Mar 2008 11:29:09 -0800 X-Client-Authorized: MaGic Cook1e X-Client-Authorized: MaGic Cook1e Received: from [192.168.1.109] (adsl-71-135-191-42.dsl.pltn13.pacbell.net [71.135.191.42]) by idiom.com (Postfix) with ESMTP id E9A802D6016; Mon, 3 Mar 2008 11:29:07 -0800 (PST) Message-ID: <47CC51BF.8050209@obviously.com> Date: Mon, 03 Mar 2008 11:30:07 -0800 From: Bryce Nesbitt User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.12) Gecko/20080203 SUSE/1.1.8-0.1 SeaMonkey/1.1.8 MIME-Version: 1.0 To: sql pgsql CC: Karsten Hilbert Subject: Re: psql word wrapping to terminal width - testers? References: <47CB98AB.1040807@obviously.com> <20080303122202.GA4028@merkur.hilbert.loc> In-Reply-To: <20080303122202.GA4028@merkur.hilbert.loc> Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.773 tagged_above=0 required=5 tests=AWL=-0.900, HTML_MESSAGE=0.001, MIME_HTML_ONLY=1.672 X-Spam-Level: X-Archive-Number: 200803/6 X-Sequence-Number: 30334

Karsten Hilbert wrote:
# \pset format aligned-wrapped
# \pset border 2
# select * from distributors order by did;
+------+--------------------+---------------------+---------------+
| did  |        name        |        descr        | long_col_name |
+------+--------------------+---------------------+---------------+
|    1 | Food fish and wine | default             |               |
|    2 | Cat Food Heaven 2  | abcdefghijklmnopqrs !               |
    
                                                    ^
Any chance you could put an indicator here to point out the
field has been wrapped ?
  
It is there but subtle.  Note the ! instead of |.

Did you consider

- a maximum length up to which fields will indeed be wrapped ?
  (\pset format aligned-wrapped 50)
  this will prevent a really large text field being wrapped to
  hundreds of lines thereby scrolling off everything else
  
Yes, but truncating the request with substr() seems to address this need.  A large field restricted in height would just blow out the width otherwise.

- ignoring wrapping bytea ?
  
Why treat bytea specially?  In many cases it's unlikely to make any sense to print on a console anyway.  How would you want bytea represented?
 
- allowing truncation of fields at a certain length before wrapping ?
  (well, this can be handled by truncating at the SQL level, too)

Even without any of the above suggestions this will be a
*very* appreciated improvement of the already excellent
psql.
Karsten