pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Bryce Nesbitt <bryce2@obviously.com>
To: pgsql-sql@postgresql.org, Tom Lane <tgl@sss.pgh.pa.us>
Subject: psql word wrapping to terminal width - testers?
Date: Sun, 02 Mar 2008 22:20:27 -0800
Message-ID: <47CB98AB.1040807@obviously.com> (raw)

I'm finishing up work on a version of the psql command line client that 
can can shrink columns until they fit in your terminal window.  For 
example on 67 column ssh session...

# \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 !               |
|      |                    | tuvwxyz             |               |
|    3 | Cat Food Heaven 3  | default             |               |
|    4 | Cat Food Heaven 4  | default             |               |
|    5 | Food Heaven        | default             |               |
|   10 | Lah                | default             |               |
|   12 | name               | line one            |               |
| 2892 ! short name         | short               |               |
| 8732 |                    |                     |               |
+------+--------------------+---------------------+---------------+
(8 rows)

...where columns 'descr' and 'did' each have a wrapped row.  I'll send a 
postgres 8.4devel linux intel binary to anyone willing to try it out.

I've got one painful edge case left to handle, but if it works well on 
various platforms, and others find it useful, I'd like to learn how and 
where to introduce it as a patch.  Any tips are appreciated.

This is intended to solve that annoying case where a few rows in a 
column are too long, blowing past the widest window you can fit onscreen.

          -Bryce Nesbitt




view thread (2+ messages)  latest in thread

Message-ID: <47CB98AB.1040807@obviously.com>
Permalink:  ../47CB98AB.1040807@obviously.com/
Also on:    postgresql.org/message-id/47CB98AB.1040807@obviously.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: bryce2@obviously.com, tgl@sss.pgh.pa.us
  Subject: Re: psql word wrapping to terminal width - testers?
  In-Reply-To: <47CB98AB.1040807@obviously.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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