Re: psql output change in 9.4

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: psql output change in 9.4
Date: 2014-08-11 17:46:07
Message-ID: CA+Tgmob5K=N3PjCCMYWvXaAMJi45ZDnRcfAdaq=fsgmsLWdVWg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Aug 8, 2014 at 9:34 PM, Peter Eisentraut <peter_e(at)gmx(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2014-08-11 17:47:28 Re: 9.4 pg_restore --help changes
Previous Message Fujii Masao 2014-08-11 17:38:07 Re: postgresql.auto.conf and reload