psql: add an optional execution-count limit to \watch.

Tom Lane <tgl@sss.pgh.pa.us>

Commit: 00beecfe839c878abb366b68272426ed5296bc2b
Author: Tom Lane <tgl@sss.pgh.pa.us>
Date: 2023-04-06T17:18:14Z
Releases: 16.0
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

Files

PathChange+/−
doc/src/sgml/ref/psql-ref.sgml modified +7 −3
src/bin/psql/command.c modified +100 −18
src/bin/psql/help.c modified +1 −1
src/bin/psql/t/001_basic.pl modified +25 −8
src/test/regress/expected/psql.out modified +1 −1
src/test/regress/sql/psql.sql modified +1 −1

Documentation touched

Discussion