From 00beecfe839c878abb366b68272426ed5296bc2b Mon Sep 17 00:00:00 2001
From: Tom Lane
Date: Thu, 6 Apr 2023 13:18:14 -0400
Subject: 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
---
doc/src/sgml/ref/psql-ref.sgml | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
(limited to 'doc/src')
diff --git a/doc/src/sgml/ref/psql-ref.sgml b/doc/src/sgml/ref/psql-ref.sgml
index 29bbec2188..53875afbf0 100644
--- a/doc/src/sgml/ref/psql-ref.sgml
+++ b/doc/src/sgml/ref/psql-ref.sgml
@@ -3551,12 +3551,16 @@ testdb=> \setenv LESS -imx4F
- \watch [ seconds ]
+ \watch [ i[nterval]=seconds ] [ c[ount]=times ] [ seconds ]
Repeatedly execute the current query buffer (as \g 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,
+ seconds can be specified
+ with or without an interval= prefix.
+ Each query result is
displayed with a header that includes the \pset title
string (if any), the time as of query start, and the delay interval.
--
cgit v1.2.3