Re: \watch 0 or \watch 0.00001 doesn't do what I want - Mailing list pgsql-hackers

From Heikki Linnakangas
Subject Re: \watch 0 or \watch 0.00001 doesn't do what I want
Date
Msg-id 57390dfe-efd5-4a92-a640-cc7eacab196c@iki.fi
Whole thread Raw
In response to \watch 0 or \watch 0.00001 doesn't do what I want  (Heikki Linnakangas <hlinnaka@iki.fi>)
Responses Re: \watch 0 or \watch 0.00001 doesn't do what I want
List pgsql-hackers
On 09/10/2024 16:38, Heikki Linnakangas wrote:
> Daniel's post [1] on \watch reminded me of this little issue I bumped into:
> 
> I wanted to run a query in a tight loop, without any delay. I tried 
> "\watch 0", but it didn't do what I wanted:
> 
> postgres=# \watch 0

Correction: This changed in version 16. It works the way I expected on 
v16, but not in earlier versions.

> Then I tried setting the delay really small, but that didn't do what I wanted either:
> 
> postgres=# \watch 0.00001
> Wed 09 Oct 2024 16:36:45 EEST (every 1e-05s)
> 
>  ?column?
> ----------
>         1
> (1 row)
> 
> ^C
> 
> It runs the query just once and then hangs forever, until I hit CTRL-C to cancel.

This issue is present on newer versions still.

-- 
Heikki Linnakangas
Neon (https://neon.tech)




pgsql-hackers by date:

Previous
From: Heikki Linnakangas
Date:
Subject: \watch 0 or \watch 0.00001 doesn't do what I want
Next
From: Heikki Linnakangas
Date:
Subject: Re: Allow default \watch interval in psql to be configured