Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VGQhz-0001Pp-5K for pgsql-hackers@arkaria.postgresql.org; Mon, 02 Sep 2013 09:46:07 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1VGQhy-0006jM-Dm for pgsql-hackers@arkaria.postgresql.org; Mon, 02 Sep 2013 09:46:06 +0000 Received: from makus.postgresql.org ([2001:4800:7903:4::125]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VGQhx-0006jE-Fw for pgsql-hackers@postgresql.org; Mon, 02 Sep 2013 09:46:05 +0000 Received: from mimolette.dalibo.net ([212.85.154.222]) by makus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VGQht-0004vK-Ov for pgsql-hackers@postgresql.org; Mon, 02 Sep 2013 09:46:04 +0000 Received: from [192.168.1.100] (AGrenoble-551-1-186-4.w92-129.abo.wanadoo.fr [92.129.145.4]) by mimolette.dalibo.net (Postfix) with ESMTPSA id 1255D4700003 for ; Mon, 2 Sep 2013 11:46:00 +0200 (CEST) Message-ID: <52245E57.1090503@dalibo.com> Date: Mon, 02 Sep 2013 11:45:59 +0200 From: Gilles Darold User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130804 Thunderbird/17.0.8 MIME-Version: 1.0 To: pgsql-hackers@postgresql.org Subject: Re: psql and pset without any arguments References: <51CE1760.3020208@dalibo.com> In-Reply-To: <51CE1760.3020208@dalibo.com> X-Enigmail-Version: 1.4.6 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Pg-Spam-Score: 0.8 (/) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org 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 . > (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