Re: [PATCH] Change wait_time column of pg_stat_lock to double precision

Kyotaro Horiguchi <horikyota.ntt@gmail.com>

From: Kyotaro Horiguchi <horikyota.ntt@gmail.com>
To: kawatatatsuya0913@gmail.com
Cc: pgsql-hackers@lists.postgresql.org
Date: 2026-06-15T07:39:22Z
Lists: pgsql-hackers
Hello.

At Mon, 15 Jun 2026 15:54:24 +0900, Tatsuya Kawata <kawatatatsuya0913@gmail.com> wrote in 
> While looking at the lock-related code, I noticed that pg_stat_lock
> is the only statistics view whose timing column (wait_time) uses
> bigint.  Every other statistics view uses double precision for
> measured-time columns.  I do not see a reason for pg_stat_lock to
> differ.

It seems to me that this was intentional. As described in the
documentation, since wait_time is only accumulated for waits longer
than deadlock_timeout, sub-millisecond precision was probably not
considered particularly useful.

Regards,

-- 
Kyotaro Horiguchi
NTT Open Source Software Center



Commits

  1. Change stat_lock.wait_time to double precision