Re: psql output change in 9.4 - Mailing list pgsql-hackers

From Robert Haas
Subject Re: psql output change in 9.4
Date
Msg-id CA+Tgmob5K=N3PjCCMYWvXaAMJi45ZDnRcfAdaq=fsgmsLWdVWg@mail.gmail.com
Whole thread Raw
In response to psql output change in 9.4  (Peter Eisentraut <peter_e@gmx.net>)
Responses Re: psql output change in 9.4
List pgsql-hackers
On Fri, Aug 8, 2014 at 9:34 PM, Peter Eisentraut <peter_e@gmx.net> wrote:
> This is 9.3:
>
> peter=# \a
> Output format is unaligned.
> peter=# \a
> Output format is aligned.
> peter=# \x
> Expanded display is on.
> peter=# \x
> Expanded display is off.
>
> This is new in 9.4:
>
> peter=# \a
> Output format (format) is unaligned.
> peter=# \a
> Output format (format) is aligned.
> peter=# \x
> Expanded display (expanded) is on.
> peter=# \x
> Expanded display (expanded) is off.
>
> What is the point of that change?
>
> I suppose it is so that you can use \pset without arguments to show all
> settings:
>
> peter=# \pset
> Border style (border) is 1.
> Target width (columns) unset.
> Expanded display (expanded) is off.
> ...
>
> But those are unrelated features, and the changed output doesn't make
> any sense in the contexts I show above.
>
> I think this should be reverted, and the \pset output should be
> implemented separately.

Yes, the \pset patch (commit c64e68fd9f1132fec563fb5de53dc3bcccb5fc3b)
caused this behavior change.   I can't remember whether I noticed it
at the time and thought it was a reasonable change, or whether I
didn't notice it when committing.

Either way, clarifying the name of the parameter which is being
displayed does not seem like particularly bad idea to me even in the
contexts you mention.  I've certainly run commands like \a and \t and
then said to myself, "crap, which pset parameter does this correspond
to?".  And there was no easy way to figure it out.

I think the output could justly be criticized for making it
insufficiently clear that the parenthesized text is, in fact, the name
of the pset parameter.  We could write something like:

Border style (parameter "border") is 1.

But I don't know whether that would be considered an improvement or
just extra verbosity.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company



pgsql-hackers by date:

Previous
From: Fujii Masao
Date:
Subject: Re: postgresql.auto.conf and reload
Next
From: Robert Haas
Date:
Subject: Re: 9.4 pg_restore --help changes