On Thu, Sep 25, 2025 at 2:42 PM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> I chanced to notice that if you ask pg_sleep for 1ms delay,
> what you actually get is 2ms, for example
Oh, wow. I tested and I get the same behavior.
> Anyway, I propose trying to get rid of this misbehavior by avoiding
> floating point in the delay computation, as attached.
Score one for my blind yet fiery hatred of floating-point arithmetic.
The patch looks good except that (places tongue firmly in cheek) it
will cause problems for users who want to sleep for more than 150,000
years.
--
Robert Haas
EDB: http://www.enterprisedb.com