Skip to content

Commit

Permalink
Merge pull request #201 from darkfronza/PG-369_fix_wal_bytes
Browse files Browse the repository at this point in the history
PG-369: Fix wal_bytes values on PG <= 12.
  • Loading branch information
ibrarahmad committed Apr 12, 2022
2 parents 75acfbb + 409f384 commit afd2e1d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pg_stat_monitor.c
Original file line number Diff line number Diff line change
Expand Up @@ -989,9 +989,9 @@ static void pgss_ProcessUtility(PlannedStmt *pstmt, const char *queryString,
instr_time duration;
uint64 rows;
BufferUsage bufusage;
WalUsage walusage;
BufferUsage bufusage_start = pgBufferUsage;
#if PG_VERSION_NUM >= 130000
WalUsage walusage;
WalUsage walusage_start = pgWalUsage;
#endif
INSTR_TIME_SET_CURRENT(start);
Expand Down Expand Up @@ -1083,7 +1083,11 @@ static void pgss_ProcessUtility(PlannedStmt *pstmt, const char *queryString,
INSTR_TIME_GET_MILLISEC(duration), /* total_time */
rows, /* rows */
&bufusage, /* bufusage */
#if PG_VERSION_NUM >= 130000
&walusage, /* walusage */
#else
NULL, /* walusage, NULL for PG <= 12 */
#endif
NULL, /* JumbleState */
PGSS_FINISHED); /* pgssStoreKind */
}
Expand Down

0 comments on commit afd2e1d

Please sign in to comment.