proposal: psql concise mode - Mailing list pgsql-hackers

From Josh Kupershmidt
Subject proposal: psql concise mode
Date
Msg-id CAK3UJREt_dBY-YwacDJe-XtzGzEeWoxB+yyHP5X3zK=Cn6qWYw@mail.gmail.com
Whole thread Raw
Responses Re: proposal: psql concise mode
Re: proposal: psql concise mode
List 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 | plainb      | 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


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: [GENERAL] Strange problem with create table as select * from table;
Next
From: Martijn van Oosterhout
Date:
Subject: Re: [GENERAL] Strange problem with create table as select * from table;