diff options
author | Tom Lane | 2023-04-06 17:18:14 +0000 |
---|---|---|
committer | Tom Lane | 2023-04-06 17:18:14 +0000 |
commit | 00beecfe839c878abb366b68272426ed5296bc2b (patch) | |
tree | 06e479aff010d16e0f86ada78fba8a5bfff156da /doc/src/sgml/ref/psql-ref.sgml | |
parent | 2820adf7755d2a377546d5b55f5b1a4a39889336 (diff) |
psql: add an optional execution-count limit to \watch.
\watch can now be told to stop after N executions of the query.
With the idea that we might want to add more options to \watch
in future, this patch generalizes the command's syntax to a list
of name=value options, with the interval allowed to omit the name
for backwards compatibility.
Andrey Borodin, reviewed by Kyotaro Horiguchi, Nathan Bossart,
Michael Paquier, Yugo Nagata, and myself
Discussion: https://postgr.es/m/CAAhFRxiZ2-n_L1ErMm9AZjgmUK=qS6VHb+0SaMn8sqqbhF7How@mail.gmail.com
Diffstat (limited to 'doc/src/sgml/ref/psql-ref.sgml')
-rw-r--r-- | doc/src/sgml/ref/psql-ref.sgml | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/doc/src/sgml/ref/psql-ref.sgml b/doc/src/sgml/ref/psql-ref.sgml index 29bbec21886..53875afbf02 100644 --- a/doc/src/sgml/ref/psql-ref.sgml +++ b/doc/src/sgml/ref/psql-ref.sgml @@ -3551,12 +3551,16 @@ testdb=> <userinput>\setenv LESS -imx4F</userinput> <varlistentry id="app-psql-meta-command-watch"> - <term><literal>\watch [ <replaceable class="parameter">seconds</replaceable> ]</literal></term> + <term><literal>\watch [ i[nterval]=<replaceable class="parameter">seconds</replaceable> ] [ c[ount]=<replaceable class="parameter">times</replaceable> ] [ <replaceable class="parameter">seconds</replaceable> ]</literal></term> <listitem> <para> Repeatedly execute the current query buffer (as <literal>\g</literal> does) - until interrupted or the query fails. Wait the specified number of - seconds (default 2) between executions. Each query result is + until interrupted, or the query fails, or the execution count limit + (if given) is reached. Wait the specified number of + seconds (default 2) between executions. For backwards compatibility, + <replaceable class="parameter">seconds</replaceable> can be specified + with or without an <literal>interval=</literal> prefix. + Each query result is displayed with a header that includes the <literal>\pset title</literal> string (if any), the time as of query start, and the delay interval. </para> |