psql: add an optional execution-count limit to \watch.
authorTom Lane <tgl@sss.pgh.pa.us>
Thu, 6 Apr 2023 17:18:14 +0000 (13:18 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Thu, 6 Apr 2023 17:18:14 +0000 (13:18 -0400)
commit00beecfe839c878abb366b68272426ed5296bc2b
tree06e479aff010d16e0f86ada78fba8a5bfff156da
parent2820adf7755d2a377546d5b55f5b1a4a39889336
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
src/bin/psql/command.c
src/bin/psql/help.c
src/bin/psql/t/001_basic.pl
src/test/regress/expected/psql.out
src/test/regress/sql/psql.sql