Re: Fix PrivateRefCount hash table key size

Nathan Bossart <nathandbossart@gmail.com>

From: Nathan Bossart <nathandbossart@gmail.com>
To: Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
Cc: pgsql-hackers@lists.postgresql.org
Date: 2025-12-04T16:29:24Z
Lists: pgsql-hackers
On Tue, Dec 02, 2025 at 02:43:25PM +0000, Bertrand Drouvot wrote:
> -	hash_ctl.keysize = sizeof(int32);
> +	hash_ctl.keysize = sizeof(Buffer);
>  	hash_ctl.entrysize = sizeof(PrivateRefCountEntry);

LGTM.  Appears to be a minor oversight in commit 4b4b680c3d, but it's of no
consequence because Buffer has been a signed 32-bit integer since commit
bdadc9bf1c.  Will go commit this.

-- 
nathan



Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. Fix key size of PrivateRefCountHash.

  2. Make backend local tracking of buffer pins memory efficient.

  3. Remove RelationGetBufferWithBuffer(), which is horribly confused about