diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2024-09-06 11:57:57 -0400 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2024-09-06 11:58:15 -0400 |
commit | dd20f950d4a37da3e71684f254fcdf4317b752b5 (patch) | |
tree | a4068403b4f3eb3c3d41d113a0014660f0f7713d /src | |
parent | 4fd4d7653e2cee887b636b7ebb0054ad62a7a506 (diff) | |
download | postgresql-dd20f950d4a37da3e71684f254fcdf4317b752b5.tar.gz postgresql-dd20f950d4a37da3e71684f254fcdf4317b752b5.zip |
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/Ztrd+XcPTz1zorkg@ip-10-97-1-34.eu-west-3.compute.internal
Diffstat (limited to 'src')
-rw-r--r-- | src/backend/utils/adt/pgstatfuncs.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/backend/utils/adt/pgstatfuncs.c b/src/backend/utils/adt/pgstatfuncs.c index 68ecd3bc66b..05e7a048075 100644 --- a/src/backend/utils/adt/pgstatfuncs.c +++ b/src/backend/utils/adt/pgstatfuncs.c @@ -1402,7 +1402,7 @@ pg_stat_get_io(PG_FUNCTION_ARGS) values[IO_COL_BACKEND_TYPE] = bktype_desc; values[IO_COL_CONTEXT] = CStringGetTextDatum(context_name); values[IO_COL_OBJECT] = CStringGetTextDatum(obj_name); - values[IO_COL_RESET_TIME] = TimestampTzGetDatum(reset_time); + values[IO_COL_RESET_TIME] = reset_time; /* * Hard-code this to the value of BLCKSZ for now. Future |