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

From Dickson S. Guedes
Subject Re: proposal: psql concise mode
Date
Msg-id 4EBC6A5E.5020009@guedesoft.net
Whole thread Raw
In response to Re: proposal: psql concise mode  (Josh Kupershmidt <schmiddy@gmail.com>)
List pgsql-hackers
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 10-11-2011 21:42, Josh Kupershmidt wrote:
> 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, username text
> );
> 
> 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.

I'm not convinced yet, because a single comment in only one column is
enough to show the "Description"'s column again.

IMHO it seems to me that the only gain of this new proposed behaviour
only happens when there is no especial information about the columns,
like comments or stat target, and I don't know if this is a common
situation.

[]s
- --
Dickson S. Guedes
mail/xmpp: guedes@guedesoft.net - skype: guediz
http://guedesoft.net - http://www.postgresql.org.br
http://github.net/guedes - twitter: @guediz
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQEcBAEBAgAGBQJOvGpeAAoJEBa5zL7BI5C7V6cH/3chliawlBO0Sf0HB2DSmHeK
AyfA+LPiKRa9Egnlt7jHIAqdiplVkfUkaP8P2L2OryexStb8eXtAWeRJjHdR11di
X15M6551vHf7fqwmCpHtNebACXDdrQefHuw9MFtPYe4jaJwy1kU7IyLQcpRjNA0s
mvPJKrH08WqdFIw0DgiZi1+EFZE2Swr/zAKbNU2snGhKA0w2juHpoBOHmlfxmXQq
Z2zWvins8nqG1lpAhhD1QZzImGpWf/W7hiXDoP2BGo9wYjU38obbVdZJHNAey75B
9C4f75vQH4MRGy/wWYEPxttLoBerQaVedfEFPyHIOoqUOpIMJeLLqbk6mY5AIDM=
=5Oez
-----END PGP SIGNATURE-----


pgsql-hackers by date:

Previous
From: Thom Brown
Date:
Subject: Re: [COMMITTERS] pgsql: Enable CHECK constraints to be declared NOT VALID
Next
From: Robert Haas
Date:
Subject: Re: LOCK_DEBUG is busted