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 --- src/bin/psql/variables.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/bin/psql/variables.h') diff --git a/src/bin/psql/variables.h b/src/bin/psql/variables.h index a95bc29f407..df23ccb987d 100644 --- a/src/bin/psql/variables.h +++ b/src/bin/psql/variables.h @@ -81,6 +81,9 @@ bool ParseVariableBool(const char *value, const char *name, bool ParseVariableNum(const char *value, const char *name, int *result); +bool ParseVariableDouble(const char *value, const char *name, + double *result, double min, double max); + void PrintVariables(VariableSpace space); bool SetVariable(VariableSpace space, const char *name, const char *value); -- cgit v1.2.3