Re: proposal: psql concise mode - Mailing list pgsql-hackers

From Josh Kupershmidt
Subject Re: proposal: psql concise mode
Date
Msg-id CAK3UJRECwFCyQ9_L85XivSnQE-jvrxcBH4gAWiGYsDMMbE6nOg@mail.gmail.com
Whole thread Raw
In response to Re: proposal: psql concise mode  (Bruce Momjian <bruce@momjian.us>)
Responses Re: proposal: psql concise mode
List pgsql-hackers
On Thu, Nov 10, 2011 at 3:41 PM, Bruce Momjian <bruce@momjian.us> wrote:
> Have you tried \d+ with this psql mode:
>
>        \pset format wrapped
>
> It wraps the data so it fits on the screen --- it is my default in my
> .psqlrc.

I think that's one of the many psql features I haven't experimented
with, thanks for the suggestion. It looks OK for some things, but I
find the column-wrapping behavior can be rather illegible, e.g.

create table test ( some_column_name serial PRIMARY KEY, another_column_name integer NOT NULL, another_col integer,
usernametext 
);

tmp=# \d+ test                             Table "public.test"    Column     |  Type   |  Modifiers   | Storage | Stats
target| Description 
----------------+---------+--------------+---------+--------------+-------------some_column_na.| integer | not null
def.|plain   |              | 
.me             |         |.ault nextval.|         |              |               |         |.('test_some_.|         |
           |               |         |.column_name_.|         |              |               |         |.seq'::regcla.|
       |              |               |         |.ss)          |         |              |another_column.| integer | not
null    | plain   |              | 
._name          |         |              |         |              |another_col    | integer |              | plain   |
           |username       | text    |              | extende.|              |               |         |
|.d      |              | 



That wrapping is pretty ugly, and the culprit is all the wasted
horizontal space for "Stats Target" and "Description" in this case
(and probably for many users, who never set either column modifier).
That output might be much nicer if, instead of "Modifiers", "Column",
and "Storage" getting squeezed, the empty "Stats Target" and
"Description" column headers got squeezed instead, giving the
populated columns more horizontal space.


pgsql-hackers by date:

Previous
From: Andrew Dunstan
Date:
Subject: Re: Parsing output of EXPLAIN command in PostgreSQL
Next
From: Tom Lane
Date:
Subject: Re: Parsing output of EXPLAIN command in PostgreSQL