pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Gilles Darold <gilles.darold@dalibo.com>
To: pgsql-hackers@postgresql.org
Subject: Re: psql and pset without any arguments
Date: Mon, 02 Sep 2013 11:45:59 +0200
Message-ID: <52245E57.1090503@dalibo.com> (raw)
In-Reply-To: <51CE1760.3020208@dalibo.com>
References: <51CE1760.3020208@dalibo.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>

Patch added to current open commitfest under the Client section with title:

   "Call \pset without any arguments displays current status of all
printing options"

Status: Need review.

Let me know if it should not be there.

Regards,

Le 29/06/2013 01:08, Gilles Darold a écrit :
> Hi,
>
> 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@[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@[local]:5494) [postgres] >
>
> 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@[local]:5494) [postgres] > \pset null 'NULL'
>         Null display is "NULL".
>         (postgres@[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



-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers



view thread (6+ messages)

Message-ID: <52245E57.1090503@dalibo.com>
Permalink:  ../52245E57.1090503@dalibo.com/
Also on:    postgresql.org/message-id/52245E57.1090503@dalibo.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: gilles.darold@dalibo.com
  Subject: Re: psql and pset without any arguments
  In-Reply-To: <52245E57.1090503@dalibo.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox