Skip to content

Commit 29aaece

Browse files
psql: Reword help message and docs for WATCH_INTERVAL
Reword the documentation around the default value to make interaction between WATCH_INTERVAL and the \watch command clearer. While there, also remove a stray parenthesis left over from a previous version of the patch. Reported-by: Peter Eisentraut <peter@eisentraut.org> Reviewed-by: David G. Johnston <david.g.johnston@gmail.com> Discussion: https://postgr.es/m/c34a650b-6f8b-4da7-9ebb-b6df03ce009d@eisentraut.org
1 parent 6e951f2 commit 29aaece

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

doc/src/sgml/ref/psql-ref.sgml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3857,7 +3857,7 @@ SELECT 1 \bind \sendpipeline
38573857
(if given) is reached, or the query no longer returns the minimum number
38583858
of rows. Wait the specified number of seconds (default 2) between executions.
38593859
The default wait can be changed with the variable
3860-
<xref linkend="app-psql-variables-watch-interval"/>).
3860+
<xref linkend="app-psql-variables-watch-interval"/>.
38613861
For backwards compatibility,
38623862
<replaceable class="parameter">seconds</replaceable> can be specified
38633863
with or without an <literal>interval=</literal> prefix.
@@ -4756,9 +4756,10 @@ bar
47564756
<term><varname>WATCH_INTERVAL</varname></term>
47574757
<listitem>
47584758
<para>
4759-
This variable sets the default interval which <command>\watch</command>
4760-
waits between executing the query. Specifying an interval in the
4761-
command overrides this variable.
4759+
This variable sets the default interval, in seconds, which
4760+
<command>\watch</command> waits between executing the query. The
4761+
default is 2 seconds. Specifying an interval in the command overrides
4762+
this variable.
47624763
</para>
47634764
</listitem>
47644765
</varlistentry>

src/bin/psql/help.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -463,8 +463,9 @@ helpVariables(unsigned short int pager)
463463
" VERSION_NAME\n"
464464
" VERSION_NUM\n"
465465
" psql's version (in verbose string, short string, or numeric format)\n");
466-
HELP0(" WATCH_INTERVAL\n"
467-
" if set to a number, overrides the default two second \\watch interval\n");
466+
HELPN(" WATCH_INTERVAL\n"
467+
" number of seconds \\watch waits between executions (default %s)\n",
468+
DEFAULT_WATCH_INTERVAL);
468469

469470
HELP0("\nDisplay settings:\n");
470471
HELP0("Usage:\n");

0 commit comments

Comments
 (0)