Re: proposal: psql concise mode

From: Josh Kupershmidt <schmiddy(at)gmail(dot)com>
To: Bruce Momjian <bruce(at)momjian(dot)us>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, "Dickson S(dot) Guedes" <listas(at)guedesoft(dot)net>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: proposal: psql concise mode
Date: 2011-11-10 23:42:53
Message-ID: CAK3UJRECwFCyQ9_L85XivSnQE-jvrxcBH4gAWiGYsDMMbE6nOg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Nov 10, 2011 at 3:41 PM, Bruce Momjian <bruce(at)momjian(dot)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.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2011-11-10 23:47:18 Re: Parsing output of EXPLAIN command in PostgreSQL
Previous Message Andrew Dunstan 2011-11-10 23:30:21 Re: Parsing output of EXPLAIN command in PostgreSQL