]> granicus.if.org Git - postgresql/commit - src/bin/psql/common.c
Allow \watch to display query execution time if \timing is enabled.
authorFujii Masao <fujii@postgresql.org>
Thu, 4 Sep 2014 03:31:48 +0000 (12:31 +0900)
committerFujii Masao <fujii@postgresql.org>
Thu, 4 Sep 2014 03:31:48 +0000 (12:31 +0900)
commitf6f654ff12c527310ddbeaf53d463d22ab46ee2c
tree438737ad356ce13ccfff87ea128447a8ae796824
parent4b91ade41fcda805a50e136edad7f95d8f35a7a9
Allow \watch to display query execution time if \timing is enabled.

Previously \watch could not display the query execution time even
when \timing was enabled because it used PSQLexec instead of
SendQuery and that function didn't support \timing. This patch
introduces PSQLexecWatch and changes \watch so as to use it, instead.
PSQLexecWatch is the function to run the query, print its results and
display how long it took (only when \timing is enabled).

This patch also changes --echo-hidden so that it doesn't print
the query that \watch executes. Since \watch cannot execute
backslash command queries, they should not be printed even
when --echo-hidden is set.

Patch by me, review by Heikki Linnakangas and Michael Paquier
src/bin/psql/command.c
src/bin/psql/common.c
src/bin/psql/common.h