psql wrapped format default for backslash-d commands

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: PostgreSQL-development <pgsql-hackers(at)postgreSQL(dot)org>
Subject: psql wrapped format default for backslash-d commands
Date: 2008-05-09 17:52:24
Message-ID: 200805091752.m49HqOO14516@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Now that psql '\pset format wrapped' is in CVS, we should consider when
we want to use 'wrapped' format by default. I think psql \df and \dT
certainly can benefit from wrapped mode. \df+ even displays, though
there is quite a bit of wrapping.

The attached patch uses wrapped format for \d* output if the current
output format is 'aligned'. It certainly helps the \df and \dT because
those outputs have normally narrow values with a few wide values that
cause aligned output to be much too wide. The downside of the patch is
that you can no longer get 'aligned' output for \d* commands anymore
because there is no way to know if the user specified 'aligned' or if
they are just using the default.

This opens the larger question that if 'wrapped' helps with \df and \dT,
wouldn't it help with other wide user query output.

Now, we can discard this patch and tell people to set their output to
'wrapped' when they issue \d commands, but it is unlikely they will do
so. We can also tell people to just default to 'wrapped' in their
.psqlrc and then their \d commands and user queries will be in
'wrapped', or we can just default 'format' to 'wrapped' for psql.

I have heard a few people say they never way to see 'wrapped' output so
perhaps we should do nothing, but I then question whether we want \df
and \dT to be hard to read by default.

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +

Attachment Content-Type Size
/pgpatches/psql_wrap text/x-diff 940 bytes

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jan Urbański 2008-05-09 18:17:22 gsoc08, text search selectivity, pg_statistics holding an array of a different type
Previous Message Alvaro Herrera 2008-05-09 16:59:41 Re: Re: [COMMITTERS] pgsql: Improve logic for finding object files on OBJS lines in contrib