In src/include/pgstat.h, the PGSTAT_NUM_TABENTRIES macro
attempts to subtract off the size of the PgStat_MsgTabstat
struct up to the m_entry[] field.  This macro was correct up
until the fields m_block_read_time and m_block_write_time
were added to that struct, as the macro was not changed to
include their size.

This patch fixes the macro.

As an aside, the PGSTAT_MSG_PAYLOAD define from which
these field sizes are being subtracted is a bit of a WAG, if
I am reading the code correctly, in which case whether the
two additional fields are subtracted from that WAG is perhaps
not critical.  But the code is certainly easier to understand if
the macro matches the definition of the struct.

Mark Dilger

Attachment: fix_PGSTAT_NUM_TABENTRIES_macro
Description: Binary data

Sent via pgsql-hackers mailing list (
To make changes to your subscription:

Reply via email to