]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Change stat_lock.wait_time to double precision
authorMichael Paquier <michael@paquier.xyz>
Tue, 30 Jun 2026 03:47:57 +0000 (12:47 +0900)
committerMichael Paquier <michael@paquier.xyz>
Tue, 30 Jun 2026 03:47:57 +0000 (12:47 +0900)
commitff6f6e0470ecb362a389bb20aac46a843e496c2f
tree6c2ab23564eb17ac7593e428cc64e31632449c6b
parent7e5a19a16c55290471c6503a2b3e50d1e14d393c
Change stat_lock.wait_time to double precision

Other statistics views (pg_stat_io, pg_stat_database, etc.) use float8
for all measured-time columns, the new pg_stat_lock standing out as an
outlier by using bigint.

This commit aligns pg_stat_lock with the other stats views for
consistency.  Like pg_stat_io, the time is stored in microseconds, and
is displayed in milliseconds with a conversion done when the view is
queried.

While on it, replace a use of "long" by PgStat_Counter, the former could
overflow for large wait times where sizeof(long) is 4 bytes (aka WIN32).

Bump catalog version.

Author: Tatsuya Kawata <kawatatatsuya0913@gmail.com>
Reviewed-by: Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
Reviewed-by: Michael Paquier <michael@paquier.xyz>
Discussion: https://postgr.es/m/CAHza6qerEiQehrbW5xaXyxvR0qJe3KBX1R4kocDz1+7Ygu8x-g@mail.gmail.com
Backpatch-through: 19
doc/src/sgml/monitoring.sgml
src/backend/storage/lmgr/proc.c
src/backend/utils/activity/pgstat_lock.c
src/backend/utils/adt/pgstatfuncs.c
src/include/catalog/catversion.h
src/include/catalog/pg_proc.dat
src/include/pgstat.h