Search Postgresql Archives

Re: Making sure \timing is on

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, May 13, 2008 at 08:14:51AM -0700, David Fetter wrote:
> On Tue, May 13, 2008 at 10:47:40AM -0400, Alvaro Herrera wrote:
> > Tom Lane escribió:
> > > Alvaro Herrera <alvherre@xxxxxxxxxxxxxxxxx> writes:
> > > > David Fetter escribi?:
> > > >> Thanks for the heads-up :)
> > > >> 
> > > >> Second patch attached, this time with some docs.
> > > 
> > > > Added to July commitfest.
> > > 
> > > Surely this is merely proof of concept and not a complete patch.
> > 
> > David, ya heard da man :-)
> 
> Next patch attached :)
> 
> Cheers,
> David (free() the malloc()s!)

*Sigh*

This time with the patch actually attached :P

Cheers,
David
-- 
David Fetter <david@xxxxxxxxxx> http://fetter.org/
Phone: +1 415 235 3778  AIM: dfetter666  Yahoo!: dfetter
Skype: davidfetter      XMPP: david.fetter@xxxxxxxxx

Remember to vote!
Consider donating to Postgres: http://www.postgresql.org/about/donate
Index: doc/src/sgml/ref/psql-ref.sgml
===================================================================
RCS file: /projects/cvsroot/pgsql/doc/src/sgml/ref/psql-ref.sgml,v
retrieving revision 1.203
diff -c -c -r1.203 psql-ref.sgml
*** doc/src/sgml/ref/psql-ref.sgml	8 May 2008 17:04:26 -0000	1.203
--- doc/src/sgml/ref/psql-ref.sgml	13 May 2008 14:41:18 -0000
***************
*** 1867,1876 ****
  
  
        <varlistentry>
!        <term><literal>\timing</literal></term>
          <listitem>
          <para>
!          Toggles a display of how long each SQL statement takes, in milliseconds.
          </para>
         </listitem>
        </varlistentry>
--- 1867,1879 ----
  
  
        <varlistentry>
!        <term><literal>\timing </literal> [<replaceable
! class="parameter">ON</replaceable> | <replaceable
! class="parameter">OFF</replaceable>] </term>
          <listitem>
          <para>
!          Without parameter, toggles a display of how long each SQL
! statement takes, in milliseconds.  With parameter, sets same.
          </para>
         </listitem>
        </varlistentry>
Index: src/bin/psql/command.c
===================================================================
RCS file: /projects/cvsroot/pgsql/src/bin/psql/command.c,v
retrieving revision 1.188
diff -c -c -r1.188 command.c
*** src/bin/psql/command.c	8 May 2008 17:04:26 -0000	1.188
--- src/bin/psql/command.c	13 May 2008 14:41:21 -0000
***************
*** 884,890 ****
  	/* \timing -- toggle timing of queries */
  	else if (strcmp(cmd, "timing") == 0)
  	{
! 		pset.timing = !pset.timing;
  		if (!pset.quiet)
  		{
  			if (pset.timing)
--- 903,914 ----
  	/* \timing -- toggle timing of queries */
  	else if (strcmp(cmd, "timing") == 0)
  	{
! 		char	   *opt = psql_scan_slash_option(scan_state,
! 											     OT_NORMAL, NULL, false);
! 		if (opt)
! 		   pset.timing = ParseVariableBool(opt);
! 		else
! 			pset.timing = !pset.timing;
  		if (!pset.quiet)
  		{
  			if (pset.timing)
***************
*** 892,897 ****
--- 916,922 ----
  			else
  				puts(_("Timing is off."));
  		}
+ 		free(opt);
  	}
  
  	/* \unset */

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux