pgsql: Assert that cutoffs are provided if freezing will be attempted

From: Melanie Plageman <melanieplageman(at)gmail(dot)com>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Assert that cutoffs are provided if freezing will be attempted
Date: 2025-11-25 21:42:41
Message-ID: E1vO0o4-001Owr-20@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Assert that cutoffs are provided if freezing will be attempted

heap_page_prune_and_freeze() requires the caller to initialize
PruneFreezeParams->cutoffs so that the function can correctly evaluate
whether tuples should be frozen. This requirement previously existed
only in comments and was easy to miss, especially after “cutoffs” was
converted from a direct function parameter to a field of the newly
introduced PruneFreezeParams struct (added in 1937ed70621). Adding an
assert makes this requirement explicit and harder to violate.

Also, fix a minor typo while we're at it.

Author: Chao Li <li(dot)evan(dot)chao(at)gmail(dot)com>
Reviewed-by: Melanie Plageman <melanieplageman(at)gmail(dot)com>
Discussion: https://postgr.es/m/0AC177F5-5E26-45EE-B273-357C51212AC5%40gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/cd38b7e77315c729ea1e52ca7b8bb0d7c20d2a3b

Modified Files
--------------
src/backend/access/heap/pruneheap.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Robert Haas 2025-11-26 00:13:03 Re: pgsql: Teach DSM registry to ERROR if attaching to an uninitialized ent
Previous Message Nathan Bossart 2025-11-25 21:16:00 Re: pgsql: Teach DSM registry to ERROR if attaching to an uninitialized ent