Re: psql expanded auto

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Noah Misch <noah(at)leadboat(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: psql expanded auto
Date: 2011-11-08 04:36:52
Message-ID: 1320727012.31945.2.camel@vanquo.pezone.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On lör, 2011-11-05 at 12:26 -0400, Noah Misch wrote:
> On Sat, Nov 05, 2011 at 04:53:56PM +0200, Peter Eisentraut wrote:
> > On fre, 2011-11-04 at 07:34 -0400, Noah Misch wrote:
> > > For "\pset format wrapped", we only use $COLUMNS when the output is a
> > > tty. I'm thinking it's best, although not terribly important, to
> > > apply the same rule to this feature.
> >
> > I think it does work that way. There is only one place where the
> > environment variable is queries, and it's used for both wrapped format
> > and expanded auto format.
>
> You're correct; given output to a non-tty and no use of \pset columns,
> output_columns always becomes zero. This makes wrapped format never wrap, but
> it makes expanded auto mode always expand. Would it be more consistent to never
> expand when output_columns == 0? That is, make these give the same output:
>
> psql -X -P expanded=auto -c "select 'a' as a"
> psql -X -P expanded=auto -c "select 'a' as a" | cat
>
> I just noticed: the help text for \x in slashUsage() will also need an update.

Here is an updated patch that addresses all the issues you pointed out.

Attachment Content-Type Size
psql-expanded-auto-v2.patch text/x-patch 10.9 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2011-11-08 04:52:37 ProcArrayLock contention
Previous Message Robert Haas 2011-11-08 04:25:31 Re: proposal: psql concise mode