Re: psql expanded auto

From: Noah Misch <noah(at)leadboat(dot)com>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: psql expanded auto
Date: 2011-11-05 16:26:27
Message-ID: 20111105162627.GB32349@tornado.leadboat.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2011-11-05 16:45:29 Re: pg_upgrade automatic testing
Previous Message Peter Eisentraut 2011-11-05 14:53:56 Re: psql expanded auto