satisfies_hash_partition crash

Robert Haas <robertmhaas@gmail.com>

From: Robert Haas <robertmhaas@gmail.com>
To: "pgsql-hackers@postgresql.org" <pgsql-hackers@postgresql.org>
Date: 2026-07-01T19:11:17Z
Lists: pgsql-hackers
Hi,

This test case crashes the server for me:

CREATE TABLE hp (a int) PARTITION BY HASH (a);
SELECT satisfies_hash_partition('hp'::regclass, 1, 0, VARIADIC NULL::int[]);

I'm inclined to mostly blame my commit
f3b0897a1213f46b4d3a99a7f8ef3a4b32e03572, which fixed related problems
but overlooked this one. I think the fix should be simple, but since
that commit is from 2017, it will need to be back-patched all the way.

--
Robert Haas
EDB: http://www.enterprisedb.com



Commits

  1. Fix multiple problems with satisfies_hash_partition.