Hello, Mikhail.
1) I'd add to comment a reason, why mutex should be last.
// Mutex should be last field, as this field isn't copied to dump file
+ /* protects the counters only. Should be the very last field, as this
field isn't copied to dump file
+ slock_t mutex;
} pgssEntry;
2) You didn't take into account the upgrade. Saved in Postgres with this
byte and try to load in version without this byte.
On 1/20/25 16:49, m.litsa...@postgrespro.ru wrote:
Hi!
Currently in pg_stat_statements save/load routines the whole pgssEntry
entity data are written/read with its last field
slock_t mutex;
which is actually not used then.
This small patch fixes this issue. Hope, it will be useful.
Respectfully,
Mikhail Litsarev,
Postgres Professional: https://postgrespro.com
--
Best wishes,
Ivan Kush
Tantor Labs LLC