File tree 2 files changed +12
-5
lines changed
2 files changed +12
-5
lines changed Original file line number Diff line number Diff line change 1
1
<!--
2
- $PostgreSQL: pgsql/doc/src/sgml/ref/psql-ref.sgml,v 1.207 2008/06/01 16:23:08 tgl Exp $
2
+ $PostgreSQL: pgsql/doc/src/sgml/ref/psql-ref.sgml,v 1.208 2008/06/11 10:48:16 heikki Exp $
3
3
PostgreSQL documentation
4
4
-->
5
5
@@ -1861,10 +1861,11 @@ lo_import 152801
1861
1861
1862
1862
1863
1863
<varlistentry>
1864
- <term><literal>\timing</literal></term>
1864
+ <term><literal>\timing [ <replaceable class="parameter">on</replaceable> | <replaceable class="parameter">off</replaceable> ] </literal></term>
1865
1865
<listitem>
1866
1866
<para>
1867
- Toggles a display of how long each SQL statement takes, in milliseconds.
1867
+ Without parameter, toggles a display of how long each SQL statement
1868
+ takes, in milliseconds. With parameter, sets same.
1868
1869
</para>
1869
1870
</listitem>
1870
1871
</varlistentry>
Original file line number Diff line number Diff line change 3
3
*
4
4
* Copyright (c) 2000-2008, PostgreSQL Global Development Group
5
5
*
6
- * $PostgreSQL: pgsql/src/bin/psql/command.c,v 1.189 2008/05/14 19: 10:29 tgl Exp $
6
+ * $PostgreSQL: pgsql/src/bin/psql/command.c,v 1.190 2008/06/11 10:48:17 heikki Exp $
7
7
*/
8
8
#include "postgres_fe.h"
9
9
#include "command.h"
@@ -884,14 +884,20 @@ exec_command(const char *cmd,
884
884
/* \timing -- toggle timing of queries */
885
885
else if (strcmp (cmd , "timing" ) == 0 )
886
886
{
887
- pset .timing = !pset .timing ;
887
+ char * opt = psql_scan_slash_option (scan_state ,
888
+ OT_NORMAL , NULL , false);
889
+ if (opt )
890
+ pset .timing = ParseVariableBool (opt );
891
+ else
892
+ pset .timing = !pset .timing ;
888
893
if (!pset .quiet )
889
894
{
890
895
if (pset .timing )
891
896
puts (_ ("Timing is on." ));
892
897
else
893
898
puts (_ ("Timing is off." ));
894
899
}
900
+ free (opt );
895
901
}
896
902
897
903
/* \unset */
You can’t perform that action at this time.
0 commit comments