Re: pg_stat_statements: improve loading and saving routines for the dump file

From: Ivan Kush <ivan(dot)kush(at)tantorlabs(dot)com>
To: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: pg_stat_statements: improve loading and saving routines for the dump file
Date: 2025-01-20 16:14:07
Message-ID: 63fd7f0d-2d49-4952-b1ec-fa877bbf0765@tantorlabs.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(dot)litsarev(at)postgrespro(dot)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

In response to

Responses

Browse pgsql-hackers by date

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