psql: Make default \watch interval configurable

Daniel Gustafsson <dgustafsson@postgresql.org>

Commit: 1a759c83278fcdae11ee5da8318b646b9d47129c
Author: Daniel Gustafsson <dgustafsson@postgresql.org>
Date: 2025-03-25T16:53:33Z
Releases: 18.0
psql: Make default \watch interval configurable

The default interval for \watch to wait between executing queries,
when executed without a specified interval, was hardcoded to two
seconds.  This adds the new variable WATCH_INTERVAL which is used
to set the default interval, making it configurable for the user.
This makes \watch the first command which has a user configurable
default setting.

Author: Daniel Gustafsson <daniel@yesql.se>
Reviewed-by: Heikki Linnakangas <hlinnaka@iki.fi>
Reviewed-by: Michael Paquier <michael@paquier.xyz>
Reviewed-by: Kirill Reshke <reshkekirill@gmail.com>
Reviewed-by: Masahiro Ikeda <ikedamsh@oss.nttdata.com>
Reviewed-by: Laurenz Albe <laurenz.albe@cybertec.at>
Reviewed-by: Greg Sabino Mullane <htamfids@gmail.com>
Reviewed-by: Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
Discussion: https://postgr.es/m/B2FD26B4-8F64-4552-A603-5CC3DF1C7103@yesql.se

Files

PathChange+/−
doc/src/sgml/ref/psql-ref.sgml modified +13 −0
src/bin/psql/command.c modified +4 −2
src/bin/psql/help.c modified +2 −0
src/bin/psql/settings.h modified +7 −0
src/bin/psql/startup.c modified +18 −0
src/bin/psql/t/001_basic.pl modified +24 −0
src/bin/psql/variables.c modified +70 −0
src/bin/psql/variables.h modified +3 −0

Documentation touched

Discussion