proposal: psql concise mode

From: Josh Kupershmidt <schmiddy(at)gmail(dot)com>
To: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: proposal: psql concise mode
Date: 2011-11-05 17:32:37
Message-ID: CAK3UJREt_dBY-YwacDJe-XtzGzEeWoxB+yyHP5X3zK=Cn6qWYw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi all,

The good news is that psql's backslash commands are becoming quite
thorough at displaying all information which could conceivably be of
interest about an object. The bad news is, psql's backslash commands
often produce a lot of noise and wasted output. (There was some
grumbling along these lines re: the recent Stats Target patch).

I'd like to propose a "concise mode" for psql, which users might turn
on via a \pset option. Concise mode would affect only the output of
psql's backslash commands. For output results which have some all-NULL
columns, as in:

test=# \d+ foo
Table "public.foo"
Column | Type | Modifiers | Storage | Stats target | Description
--------+---------+-----------+---------+--------------+-------------
a | integer | | plain | |
b | integer | | plain | |
Has OIDs: no

Concise mode would simply omit the all-NULL columns, so that the
output would look like this:

test=# \d+ foo
Table "public.foo"
Column | Type | Storage
--------+---------+---------
a | integer | plain
b | integer | plain
Has OIDs: no

For actually implementing this: it'd be nice if the changes could be
localized to printQuery(). Unfortunately, there are a few stragglers
such as describeOneTableDetails() which have their own notions about
how to print their output, so I'm not sure how straightforward/small
such a patch would be.

But I just wanted to throw the idea out there. Any thoughts?

Josh

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Martijn van Oosterhout 2011-11-05 18:20:23 Re: Strange problem with create table as select * from table;
Previous Message Peter Eisentraut 2011-11-05 16:45:29 Re: pg_upgrade automatic testing