Re: pg_test_timing: fix unit typo and widen diff type - Mailing list pgsql-hackers

From Fujii Masao
Subject Re: pg_test_timing: fix unit typo and widen diff type
Date
Msg-id CAHGQGwEp21h5JUHLP0Rj2GMuOVtH_5E7y3J=BW9yVT8gNaSgLQ@mail.gmail.com
Whole thread
In response to Re: pg_test_timing: fix unit typo and widen diff type  (Chao Li <li.evan.chao@gmail.com>)
Responses Re: pg_test_timing: fix unit typo and widen diff type
List pgsql-hackers
On Thu, Apr 23, 2026 at 11:03 AM Chao Li <li.evan.chao@gmail.com> wrote:
> I just checked old branches. Looks like 0001 can be back-patched down to v10. Yes, pre-19, all branches use
microsecond,so the back-patch should change “ms” to “us”. 

Thanks! So I've pushed this unit change to master and backpatched it to
all supported branches.


> For v16 to v18, we can make a tiny improvement by replacing “1e9” with a constant macro NS_PER_S. This change has
beenincluded in the diff. 

This change looks good to me. However, we should generally keep changes to
old stable branches to the minimum required, so I applied this change only
to master with 0002 patch.


> I see 0002 a bit differently. In v19, the unit changed from microseconds to nanoseconds, which introduced a potential
overflow:nanoseconds require int64, but the local variable remained int32. So I think this is actually a v19-only bug. 

OK, I've pushed 0002 patch. Thanks!

Regards,

--
Fujii Masao



pgsql-hackers by date:

Previous
From: Peter Smith
Date:
Subject: Re: Redundant/mis-use of _(x) gettext macro?
Next
From: Chao Li
Date:
Subject: Re: pg_test_timing: fix unit typo and widen diff type