Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Data Bases > Pgsql General > Re: Making sure...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 9 of 13 Topic 15505 of 16941
Post > Topic >>

Re: Making sure \timing is on

by david@[EMAIL PROTECTED] (David Fetter) May 12, 2008 at 02:57 PM

--MW5yreqqjyrRcusr
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

On Mon, May 12, 2008 at 05:30:48PM -0400, Bruce Momjian wrote:
> David Fetter wrote:
> > On Sun, May 11, 2008 at 11:48:29PM -0400, Tom Lane wrote:
> > > "Scott Marlowe" <scott.marlowe@[EMAIL PROTECTED]
> writes:
> > > > Is it reasonable behavior to have \timing along toggle and \timing
on
> > > > / \timing off be a forced switch?  Just thinking of other scripts
> > > > where this isn't a problem and having to update them.
> > > 
> > > The command without an argument should certainly keep the old toggle
> > > behavior, for backwards compatibility.
> > 
> > Attached patch does some of the right thing, but doesn't yet handle
> > error cases.  How liberal should we be about capitalization, spelling,
> > etc.?
> 
> Please try ParseVariableBool() in psql/variables.c, and use diff -c.

Thanks for the heads-up :)

Second patch attached, this time with some docs.

Cheers,
David.
-- 
David Fetter <david@[EMAIL PROTECTED]
> http://fetter.org/
Phone: +1 415 235 3778  AIM: dfetter666  Yahoo!: dfetter
Skype: davidfetter      XMPP: david.fetter@[EMAIL PROTECTED]
 to vote!
Consider donating to Postgres: http://www.postgresql.org/about/donate

--MW5yreqqjyrRcusr
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="psql_set_timing.patch"

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 -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	12 May 2008 21:56:59 -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 -r1.188 command.c
*** src/bin/psql/command.c	8 May 2008 17:04:26 -0000	1.188
--- src/bin/psql/command.c	12 May 2008 21:57:01 -0000
***************
*** 884,890 ****
  	/* \timing -- toggle timing of queries */
  	else if (strcmp(cmd, "timing") == 0)
  	{
! 		pset.timing = !pset.timing;
  		if (!pset.quiet)
  		{
  			if (pset.timing)
--- 884,895 ----
  	/* \timing -- toggle timing of queries */
  	else if (strcmp(cmd, "timing") == 0)
  	{
! 		char	   *value = psql_scan_slash_option(scan_state,
! 												   OT_NORMAL, NULL, false);
! 		if (value)
! 		   pset.timing = ParseVariableBool(value);
! 		else
! 			pset.timing = !pset.timing;
  		if (!pset.quiet)
  		{
  			if (pset.timing)

--MW5yreqqjyrRcusr
Content-Type: text/plain
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0


-- 
Sent via pgsql-general mailing list (pgsql-general@[EMAIL PROTECTED]
)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

--MW5yreqqjyrRcusr--
 




 13 Posts in Topic:
Making sure \timing is on
lists@[EMAIL PROTECTED]   2008-05-11 19:52:00 
Re: Making sure \timing is on
tgl@[EMAIL PROTECTED] (T  2008-05-11 20:24:17 
Re: Making sure \timing is on
lists@[EMAIL PROTECTED]   2008-05-11 22:43:19 
Re: Making sure \timing is on
tgl@[EMAIL PROTECTED] (T  2008-05-11 23:04:33 
Re: Making sure \timing is on
scott.marlowe@[EMAIL PROT  2008-05-11 21:25:54 
Re: Making sure \timing is on
tgl@[EMAIL PROTECTED] (T  2008-05-11 23:48:29 
Re: Making sure \timing is on
david@[EMAIL PROTECTED]   2008-05-12 14:17:06 
Re: Making sure \timing is on
bruce@[EMAIL PROTECTED]   2008-05-12 17:30:48 
Re: Making sure \timing is on
david@[EMAIL PROTECTED]   2008-05-12 14:57:57 
Re: Making sure \timing is on
alvherre@[EMAIL PROTECTED  2008-05-13 10:26:26 
Re: Making sure \timing is on
tgl@[EMAIL PROTECTED] (T  2008-05-13 10:38:26 
Re: Making sure \timing is on
alvherre@[EMAIL PROTECTED  2008-05-13 10:47:40 
Re: Making sure \timing is on
alvherre@[EMAIL PROTECTED  2008-05-12 17:32:56 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sat Oct 11 12:37:37 CDT 2008.