psql word wrapping to terminal width - testers?

From: Bryce Nesbitt <bryce2(at)obviously(dot)com>
To: pgsql-sql(at)postgresql(dot)org, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Subject: psql word wrapping to terminal width - testers?
Date: 2008-03-03 06:20:27
Message-ID: 47CB98AB.1040807@obviously.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

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

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Gerardo Herzig 2008-03-03 13:15:48 compiling plpython compilation error
Previous Message Bruce Momjian 2008-03-02 21:32:21 Re: Bouncing replies [was: SQL standards in Mysql]