From 1a759c83278fcdae11ee5da8318b646b9d47129c Mon Sep 17 00:00:00 2001 From: Daniel Gustafsson Date: Tue, 25 Mar 2025 17:53:33 +0100 Subject: 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 Reviewed-by: Heikki Linnakangas Reviewed-by: Michael Paquier Reviewed-by: Kirill Reshke Reviewed-by: Masahiro Ikeda Reviewed-by: Laurenz Albe Reviewed-by: Greg Sabino Mullane Reviewed-by: Ashutosh Bapat Discussion: https://postgr.es/m/B2FD26B4-8F64-4552-A603-5CC3DF1C7103@yesql.se --- doc/src/sgml/ref/psql-ref.sgml | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'doc/src') diff --git a/doc/src/sgml/ref/psql-ref.sgml b/doc/src/sgml/ref/psql-ref.sgml index f083dba49a9..f7c8bc16a7f 100644 --- a/doc/src/sgml/ref/psql-ref.sgml +++ b/doc/src/sgml/ref/psql-ref.sgml @@ -3852,6 +3852,8 @@ SELECT 1 \bind \sendpipeline until interrupted, or the query fails, or the execution count limit (if given) is reached, or the query no longer returns the minimum number of rows. Wait the specified number of seconds (default 2) between executions. + The default wait can be changed with the variable + ). For backwards compatibility, seconds can be specified with or without an interval= prefix. @@ -4746,6 +4748,17 @@ bar + + WATCH_INTERVAL + + + This variable sets the default interval which \watch + waits between executing the query. Specifying an interval in the + command overrides this variable. + + + + -- cgit v1.2.3