Re: psql and pset without any arguments

From: Marc Mamin <M(dot)Mamin(at)intershop(dot)de>
To: Gilles Darold <gilles(dot)darold(at)dalibo(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: psql and pset without any arguments
Date: 2013-06-29 11:02:00
Message-ID: B6F6FD62F2624C4C9916AC0175D56D880CE00E0E@jenmbs01.ad.intershop.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


>Von: pgsql-hackers-owner(at)postgresql(dot)org [pgsql-hackers-owner(at)postgresql(dot)org]&quot; im Auftrag von &quot;Gilles Darold [gilles(dot)darold(at)dalibo(dot)com]

>I was looking at psql 8.3 documention about \pset options and saw that
>there was the following note :
>
> "Note: It is an error to call \pset without any arguments. In the
>future this case might show the current status of all printing options."
>
>I looked backward and forward to find that this note is present in all
>versions since 7.1 up to 9.3, maybe it is time to add this little feature.
>
>I've attached a patch to add the usage of the \pset command without any
>arguments to displays current status of all printing options instead of
>the error message. Here is a sample output:
>
> (postgres(at)[local]:5494) [postgres] > \pset
> Output format is aligned.
> Border style is 2.
> Expanded display is used automatically.
> Null display is "NULL".
> Field separator is "|".
> Tuples only is off.
> Title is unset.
> Table attributes unset.
> Line style is unicode.
> Pager is used for long output.
> Record separator is <newline>.
> (postgres(at)[local]:5494) [postgres] >

Hello,
this is a nice additional feature.
As a user (not a hacker), I would prefer to see the real parameter name instead of the "display name".

e.g.
Border style is 2.
=>
border = 2

without this, the user would not know out of the fly which parameter to modify...

best regards,
Marc Mamin

>To avoid redundant code I've added a new method printPsetInfo() so that
>do_pset() and exec_command() will used the same output message, they are
>all in src/bin/psql/command.c. For example:
>
> (postgres(at)[local]:5494) [postgres] > \pset null 'NULL'
> Null display is "NULL".
> (postgres(at)[local]:5494) [postgres] >
>
>The patch print all variables information from struct printTableOpt when
>\pset is given without any arguments and also update documentation.
>
>Let me know if there's any additional work to do on this basic patch or
>something that I've omitted.
>
>Best regards,
>
>--
>Gilles Darold
>http://dalibo.com - http://dalibo.org

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Pavel Stehule 2013-06-29 11:07:16 proposal: simple date constructor from numeric values
Previous Message Heikki Linnakangas 2013-06-29 10:03:55 GIN low hanging fruit