Fix incorrect pg_stat_io output on 32-bit machines.
authorTom Lane <[email protected]>
Fri, 6 Sep 2024 15:57:57 +0000 (11:57 -0400)
committerTom Lane <[email protected]>
Fri, 6 Sep 2024 15:58:15 +0000 (11:58 -0400)
commitdd20f950d4a37da3e71684f254fcdf4317b752b5
treea4068403b4f3eb3c3d41d113a0014660f0f7713d
parent4fd4d7653e2cee887b636b7ebb0054ad62a7a506
Fix incorrect pg_stat_io output on 32-bit machines.

pg_stat_get_io() applied TimestampTzGetDatum twice to the
stat_reset_timestamp value.  On 64-bit builds that's harmless because
TimestampTzGetDatum is a no-op, but on 32-bit builds it results in
displaying garbage in the stats_reset column of the pg_stat_io view.

Bug dates to commit a9c70b46d which introduced pg_stat_io, so
back-patch to v16 where that came in.

Bertrand Drouvot

Discussion: https://postgr.es/m/[email protected]
src/backend/utils/adt/pgstatfuncs.c