Re: psql output change in 9.4

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Bruce Momjian <bruce(at)momjian(dot)us>, Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: psql output change in 9.4
Date: 2014-10-12 04:17:31
Message-ID: 543A00DB.7060100@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 10/11/14 8:25 PM, Bruce Momjian wrote:
> On Mon, Aug 11, 2014 at 02:28:45PM -0400, Robert Haas wrote:
>> On Mon, Aug 11, 2014 at 1:52 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>>> Robert Haas <robertmhaas(at)gmail(dot)com> writes:
>>>> On Fri, Aug 8, 2014 at 9:34 PM, Peter Eisentraut <peter_e(at)gmx(dot)net> wrote:
>>>>> What is the point of that change?
>>>
>>>> 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.
>>>
>>> Quite; that wasn't apparent to me either.
>>>
>>>> We could write something like:
>>>> Border style (parameter "border") is 1.
>>>
>>> How about
>>>
>>> Border style (\pset border) is 1.
>>
>> That would look just fine as a response to \a or \x, but I'm not sure
>> it would look as good as a response to \pset, which prints out that
>> line for every parameter ("why does every line say \pset when the
>> command I just typed is \pset?"). However, I can certainly live with
>> it if others prefer that to what I suggested.
>
> I went with quoting the pset variable:
>
> test=> \a
> Output format ("format") is aligned.
> test=> \x
> Expanded display ("expanded") is on.
>
> Patch attached. I think this would be for 9.5 only, at this point.

Funny, I was *just* working on that, too. I propose a patch that
reverts the output to how it was in 9.3 (without anything in
parentheses), and implements the output of \pset without any arguments
separately, thus:

# \a
Output format is unaligned.

# \pset
border 2
columns 0
expanded auto
fieldsep '|'
fieldsep_zero off
footer on
format unaligned
linestyle unicode
null ''
numericlocale off
pager 1
recordsep '\n'
recordsep_zero off
tableattr
title
tuples_only off

(This is also symmetric with what \set outputs.)

On closer examination, the change in 9.4, besides having the aesthetic
issues discussed earlier, also created some outright incorrect output by
mixing together fieldsep/fieldsep_zero and recordsep/recordsep_zero.
These issues become much clearer if you separate the case of "this is
what you just set" from "these are all the current settings".

Attachment Content-Type Size
pset.patch text/x-patch 10.1 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2014-10-12 05:16:23 Re: split builtins.h to quote.h
Previous Message Fabrízio de Royes Mello 2014-10-12 03:13:32 Re: pg_dump refactor patch to remove global variables