1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-03 20:02:46 +03:00

Add \timing patch to psql. Times all queries.

Greg Sabino Mullane
This commit is contained in:
Bruce Momjian
2002-03-05 00:01:03 +00:00
parent 294f0d4bd6
commit 25b0b09fd3
6 changed files with 57 additions and 8 deletions

View File

@ -3,7 +3,7 @@
*
* Copyright 2000 by PostgreSQL Global Development Group
*
* $Header: /cvsroot/pgsql/src/bin/psql/command.c,v 1.66 2002/02/25 21:37:42 tgl Exp $
* $Header: /cvsroot/pgsql/src/bin/psql/command.c,v 1.67 2002/03/05 00:01:00 momjian Exp $
*/
#include "postgres_fe.h"
#include "command.h"
@ -715,6 +715,24 @@ exec_command(const char *cmd,
free(value);
}
/* \timing -- toggle timing of queries */
else if (strcmp(cmd, "timing") == 0)
{
pset.timing = !pset.timing;
if (!quiet)
{
if (pset.timing)
{
puts(gettext(("Timing is on.")));
}
else
{
puts(gettext(("Timing is off.")));
}
}
}
/* \unset */
else if (strcmp(cmd, "unset") == 0)
{