Re: \watch 0 or \watch 0.00001 doesn't do what I want

Michael Paquier <michael@paquier.xyz>

From: Michael Paquier <michael@paquier.xyz>
To: "Andrey M. Borodin" <x4mmm@yandex-team.ru>
Cc: Tom Lane <tgl@sss.pgh.pa.us>, Heikki Linnakangas <hlinnaka@iki.fi>, "pgsql-hackers@postgresql.org" <pgsql-hackers@postgresql.org>, Daniel Gustafsson <daniel@yesql.se>
Date: 2024-10-13T03:04:23Z
Lists: pgsql-hackers
On Thu, Oct 10, 2024 at 10:47:25AM +0500, Andrey M. Borodin wrote:
> Let’s add a comment to tight-loop if statement. And a test for the case.

+       /* Tight loop, no wait needed */
+       if (sleep_ms == 0)

Okay about this addition.

+psql_like($node, sprintf('SELECT 1 \watch c=3 i=%g', 0.0001),
+   qr/1\n1\n1/, '\watch with 3 iterations');

And I am fine with this addition as well, for the sleep_ms == 0 case.
--
Michael

Commits

  1. psql: Fix \watch when using interval values less than 1ms