Re: pg_stat_statements: improve loading and saving routines for the dump file - Mailing list pgsql-hackers

From Ivan Kush
Subject Re: pg_stat_statements: improve loading and saving routines for the dump file
Date
Msg-id 63fd7f0d-2d49-4952-b1ec-fa877bbf0765@tantorlabs.com
Whole thread Raw
List pgsql-hackers
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.litsarev@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




pgsql-hackers by date:

Previous
From: jian he
Date:
Subject: Re: Non-text mode for pg_dumpall
Next
From: Logan MAUZAIZE
Date:
Subject: Proper way to clean-up connection for reuse (`DISCARD ALL` and default role)