postgresql/src/bin/psql
Michael Paquier 9f34cae142 psql: Fix \watch when using interval values less than 1ms
Attempting to use an interval of time less than 1ms would cause \watch
to hang.  This was confusing, so let's change the logic so as an
interval lower than 1ms behaves the same as 0.

Comments are added to mention that the internals of do_watch() had
better rely on "sleep_ms", the interval value in milliseconds.  While on
it, this commit adds a test to check the behavior of interval values
less than 1ms.

\watch hanging for interval values less than 1ms existed before
6f9ee74d45, that has changed the code to support an interval value of
0.

Reported-by: Heikki Linnakangas
Author: Andrey M. Borodin, Michael Paquier
Discussion: https://postgr.es/m/88445e0e-3156-4b9d-afae-9a1a7b1631f6@iki.fi
Backpatch-through: 16
2024-10-14 12:27:51 +09:00
..
po Translation updates 2024-06-24 13:11:27 +02:00
t psql: Fix \watch when using interval values less than 1ms 2024-10-14 12:27:51 +09:00
.gitignore Convert tab-complete's long else-if chain to a switch statement. 2024-10-07 12:22:10 -04:00
command.c psql: Fix \watch when using interval values less than 1ms 2024-10-14 12:27:51 +09:00
command.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
common.c psql: Clean up more aggressively state of \bind[_named], \parse and \close 2024-09-19 15:39:01 +09:00
common.h psql: Clean up more aggressively state of \bind[_named], \parse and \close 2024-09-19 15:39:01 +09:00
copy.c Do not treat \. as an EOF marker in CSV mode for COPY IN. 2024-09-30 17:57:12 -04:00
copy.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
create_help.pl Update copyright for 2024 2024-01-03 20:49:05 -05:00
crosstabview.c Use new overflow-safe integer comparison functions. 2024-02-16 14:05:36 -06:00
crosstabview.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
describe.c Fix psql describe commands' handling of ACL columns for old servers. 2024-09-24 17:21:38 -04:00
describe.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
gen_tabcomplete.pl Don't hard-code the input file name in gen_tabcomplete.pl's output. 2024-10-10 17:02:08 -04:00
help.c psql: Add more meta-commands able to use the extended protocol 2024-08-22 16:25:57 +09:00
help.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
input.c Update copyright for 2024 2024-01-03 20:49:05 -05:00
input.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
large_obj.c Update copyright for 2024 2024-01-03 20:49:05 -05:00
large_obj.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
mainloop.c Update copyright for 2024 2024-01-03 20:49:05 -05:00
mainloop.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
Makefile Convert tab-complete's long else-if chain to a switch statement. 2024-10-07 12:22:10 -04:00
meson.build Don't hard-code the input file name in gen_tabcomplete.pl's output. 2024-10-10 17:02:08 -04:00
nls.mk More use of getpwuid_r() directly 2024-09-02 09:04:30 +02:00
prompt.c Update copyright for 2024 2024-01-03 20:49:05 -05:00
prompt.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
psqlrc.sample Improve FILES section of psql reference page. 2014-01-14 19:27:57 -05:00
psqlscanslash.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
psqlscanslash.l Allow noise semicolons ending psql \sf, \ef, \sv, \ev commands. 2024-01-10 14:20:09 -05:00
settings.h psql: Add more meta-commands able to use the extended protocol 2024-08-22 16:25:57 +09:00
startup.c Update copyright for 2024 2024-01-03 20:49:05 -05:00
stringutils.c Update copyright for 2024 2024-01-03 20:49:05 -05:00
stringutils.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
tab-complete.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
tab-complete.in.c Avoid possible segfault in psql's tab completion. 2024-10-10 16:17:38 -04:00
variables.c Update copyright for 2024 2024-01-03 20:49:05 -05:00
variables.h Update copyright for 2024 2024-01-03 20:49:05 -05:00