Re: Switch PgStat_HashKey.objoid from Oid to uint64

Michael Paquier <michael@paquier.xyz>

From: Michael Paquier <michael@paquier.xyz>
To: Heikki Linnakangas <hlinnaka@iki.fi>
Cc: Postgres hackers <pgsql-hackers@lists.postgresql.org>
Date: 2024-08-28T23:56:59Z
Lists: pgsql-hackers

Attachments

On Mon, Aug 26, 2024 at 09:32:54AM +0300, Heikki Linnakangas wrote:
> Currently, we rely on the fact that all the xl_xact_* structs require
> sizeof(int) alignment. See comment above struct xl_xact_xinfo.

Thanks, I have missed this part.  So that explains the alignment I'd
better use in the record.

> One idea is to store the uint64 as two uint32's.

Nice, we could just do that.  This idea makes me feel much better than
sticking more aligment macros in the paths where the record is built.

Attached is an updated patch doing that.  ubsan is silent with that.
--
Michael

Commits

  1. Extend PgStat_HashKey.objid from 4 to 8 bytes