Re: psql wrapped format default for backslash-d commands

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Brendan Jurd <direvus(at)gmail(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: psql wrapped format default for backslash-d commands
Date: 2008-05-09 20:07:57
Message-ID: 200805092007.m49K7ve05231@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Brendan Jurd wrote:

[ email paragraphs reordered.]

> I seem to recall there was some discussion of an "auto" mode in the
> original wrapping thread, but if there was any meaningful conclusion I
> lost it in amongst the width detection flame war.

I wasn't going to bring up the 'auto' idea yet because it might confuse
things, but I guess I should address it now.

"wrapped" format doesn't wrap if the column headings don't fit the
screen width _without_ wrapping (it then uses 'aligned'). My idea was
for an 'auto' format mode to use wrapped, or expanded if wrapped can't
be displayed.

> > 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.
> >
>
> Doesn't this suggest that we need an "auto" formatting mode which has
> the semantics "let psql decide what format mode I want"?

The big problem is unless we default psql to 'auto' we can't know if
they really want 'aligned', 'wrapped', or whatever looks good on the
screen, 'auto'.

> Then the people who object to wrapped mode can just set formatting to
> aligned explicitly and be done with it.

Right, but 'wrapped' is kind of a dramatic change so we have to be sure
most people wanted 'wrapped' (or 'auto'). I think the way we did the
detection defaults will help because a default of 'auto' will only
affect screen output, 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. +

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Heikki Linnakangas 2008-05-09 20:11:08 Re: gsoc08, text search selectivity, pg_statistics holding an array of a different type
Previous Message Stephen Frost 2008-05-09 19:19:35 Re: constraint exclusion analysis caching