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-14T03:29:31Z
Lists: pgsql-hackers
On Sun, Oct 13, 2024 at 12:04:23PM +0900, Michael Paquier wrote:
> +       /* 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.

I have done an extra lookup, tweaked a few things, and backpatched
that down to v16.
--
Michael

Commits

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