diff options
author | Heikki Linnakangas <heikki.linnakangas@iki.fi> | 2008-06-11 10:48:17 +0000 |
---|---|---|
committer | Heikki Linnakangas <heikki.linnakangas@iki.fi> | 2008-06-11 10:48:17 +0000 |
commit | 8b64a2642a6cf9aa5ce439ec2862e1d2bb968be7 (patch) | |
tree | 78517db04af38b82d03dcf2bc3a4ed86ffea054b /src | |
parent | 96675bff1f49d2d846750e344d3adc409e6bad73 (diff) | |
download | postgresql-8b64a2642a6cf9aa5ce439ec2862e1d2bb968be7.tar.gz postgresql-8b64a2642a6cf9aa5ce439ec2862e1d2bb968be7.zip |
Add optional on/off argument to \timing.
David Fetter.
Diffstat (limited to 'src')
-rw-r--r-- | src/bin/psql/command.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/bin/psql/command.c b/src/bin/psql/command.c index b86d67e9281..1a1241bd5c7 100644 --- a/src/bin/psql/command.c +++ b/src/bin/psql/command.c @@ -3,7 +3,7 @@ * * Copyright (c) 2000-2008, PostgreSQL Global Development Group * - * $PostgreSQL: pgsql/src/bin/psql/command.c,v 1.189 2008/05/14 19:10:29 tgl Exp $ + * $PostgreSQL: pgsql/src/bin/psql/command.c,v 1.190 2008/06/11 10:48:17 heikki Exp $ */ #include "postgres_fe.h" #include "command.h" @@ -884,7 +884,12 @@ exec_command(const char *cmd, /* \timing -- toggle timing of queries */ else if (strcmp(cmd, "timing") == 0) { - pset.timing = !pset.timing; + 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,6 +897,7 @@ exec_command(const char *cmd, else puts(_("Timing is off.")); } + free(opt); } /* \unset */ |