Re: PgStat_HashKey padding issue when passed by reference

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Sami Imseih <samimseih(at)gmail(dot)com>
Cc: Andres Freund <andres(at)anarazel(dot)de>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: PgStat_HashKey padding issue when passed by reference
Date: 2025-09-18 02:49:11
Message-ID: aMtzJxPHu3Ddx7fu@paquier.xyz
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Sep 17, 2025 at 07:04:36PM -0500, Sami Imseih wrote:
> "NB: We assume that this struct contains no padding. Also, 8 bytes
> allocated for the object ID are good enough to ensure the uniqueness
> of the hash key, hence the addition of new fields is not recommended."

Works for me.

> Also, what about we also add the assert as done earlier in this thread [0]
> to ensure that the struct indeed does not have padding?

I still want to add it, but it also seemed like you were not much a
fan of it, so I did not really want to push forward with something
that was not loved. :D

Addressing your points, attached is an updated patch labelled v2.
--
Michael

Attachment Content-Type Size
v2-0001-Document-no-padding-rule-for-PgStat_HashKey.patch text/x-diff 3.7 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Fujii Masao 2025-09-18 03:03:24 Re: pg_restore --no-policies should not restore policies' comment
Previous Message Fujii Masao 2025-09-18 02:23:52 Re: pgbench: remove an unused function argument