Re: Implicit conversion from int64 to int32 when calling hash_get_num_entries - Mailing list pgsql-hackers

From Daniel Gustafsson
Subject Re: Implicit conversion from int64 to int32 when calling hash_get_num_entries
Date
Msg-id 902107CC-6296-4888-8228-C7D3C4167735@yesql.se
Whole thread
In response to Implicit conversion from int64 to int32 when calling hash_get_num_entries  (Karina Litskevich <litskevichkarina@gmail.com>)
Responses Re: Implicit conversion from int64 to int32 when calling hash_get_num_entries
List pgsql-hackers
> On 13 Jul 2026, at 17:00, Karina Litskevich <litskevichkarina@gmail.com> wrote:

> Simply changing num_entries to int64 leads to the change of the file
> header format. I suggest changing num_entries to int64 in PG19 and
> later, because it wasn't released yet, and pgss files generated by
> another major version are considered to be incompatible anyway. See
> the v1 patch attached.

Agreed, I think we should make sure to do this once beta2 has shipped for the
next beta release.

> Doing the same in already released versions would require increasing
> PGSS_FILE_HEADER version. I don't think it's worth it, so for older
> versions I suggest just adding a comment, a check, and an explicit
> conversion to int32. See the second patch attached.

Given the likelihood of an issue in backbranches, we could also only apply for
v19 and leave the backbranches.

> Another minor problem I noticed was the definition of pgver. It's
> defined as int32, but used as uint32. So I fixed it in both patches.

Makes sense.

--
Daniel Gustafsson




pgsql-hackers by date:

Previous
From: Sami Imseih
Date:
Subject: Re: [Proposal] Adding callback support for custom statistics kinds
Next
From: "Jelte Fennema-Nio"
Date:
Subject: Re: Don't use the deprecated and insecure PQcancel in our frontend tools anymore