Re: PgStat_HashKey padding issue when passed by reference

Поиск
Список
Период
Сортировка
От Michael Paquier
Тема Re: PgStat_HashKey padding issue when passed by reference
Дата
Msg-id aMI5pF80G9EnRGBD@paquier.xyz
обсуждение исходный текст
Ответ на Re: PgStat_HashKey padding issue when passed by reference  (Sami Imseih <samimseih@gmail.com>)
Ответы Re: PgStat_HashKey padding issue when passed by reference
Re: PgStat_HashKey padding issue when passed by reference
Список pgsql-hackers
On Mon, Sep 08, 2025 at 09:36:52PM -0500, Sami Imseih wrote:
> But my concern is the flexibility of this approach. If someone is to add an
> OID field next, they will not be able to as that will be introducing
> padding.  On the other hand, passing the key by reference and
> documenting the reason in pgstat_shmem.c will not lose this
> flexibility.

I don't mind discarding the static assertion idea, but at the end what
counts for me here is that I don't want to sacrifice future changes in
the pgstats code that would always require passing around the hash key
by reference.  So I would just do like attached, documenting at the
top of PgStat_HashKey that we should not have padding in it, removing
three memset(0) calls that expected it.
--
Michael

Вложения

В списке pgsql-hackers по дате отправления: