Dec 2025

7 commits
btree_gist: Fix memory allocation formula
18 Dec 2025Michael Paquiermaster19beta1REL_19_STABLE19beta1Also in: Fix and improve allocation formulas (part of a posted patchset)
LLM analysis, 100% surepart of a posted patchsetmoderate changesfrom patchset #171 of 1 reviewer saw the final version

The commit combines David's palloc_array() conversion from #17 in contrib/btree_gist/btree_utils_var.c with Bertrand's GBT_VARKEY allocation-type correction from #608825 in thread #52879, plus the committer's adjacent Vsrt conversion. Its explicit explanation of the complementary proposals supports partial provenance in both threads, consistent with the other thread's verdict despite its later submission.

  • Michael Paquiersaw the final versioncommittercommitted the patch
Use palloc_object() and palloc_array(), the last change
11 Dec 2025Michael Paquiermaster19beta1REL_19_STABLE19beta1
LLM analysis, 100% surepart of a posted patchsetlight changesfrom patchset #173 of 3 reviewers saw the final version

This takes seven files from the non-trivial portion of #17, retaining conversions in pg_buffercache, pg_trgm, postgres_fdw, execPartition.c, partprune.c, mvdistinct.c and bufmgr.c. It omits several arithmetic conversions and whole-file changes, with formatting adjustments and the separately fixed pg_buffercache allocation as its new base, consistent with #26.

  • Tom Lanesaw the final versionLLM analysis, 88% sureTom identified changed expression grouping in #8 and supported separating potentially substantive changes in #15, leading to the separately reviewed portion of #17 from which these conversions were selected.
  • Thomas Munrosaw the final versionLLM analysis, 86% sureThomas requested generated-code comparison in #12, which David performed in #13 and used to isolate the non-trivial conversions in #17.
  • Michael Paquiersaw the final versioncommittercommitted the patch
pg_buffercache: Fix memory allocation formula
11 Dec 2025Michael Paquiermaster19beta1REL_19_STABLE19beta1REL_18_STABLE18.2
LLM analysis, 100% surepart of a posted patchsetlight changesfrom patchset #171 of 1 reviewer saw the final version

This extracts the os_page_status element-size correction from #17 in contrib/pg_buffercache/pg_buffercache_pages.c, using palloc(sizeof(int) * os_page_count) instead of the proposed palloc_array(int, os_page_count). Michael confirmed the original uint64 formula overallocated memory and backpatched the fix through PostgreSQL 18 in #26.

  • Michael Paquiersaw the final versioncommittercommitted the patch
Fix allocation formula in llvmjit_expr.c
11 Dec 2025Michael Paquiermaster19beta1REL_19_STABLE19beta1REL_18_STABLE18.2REL_17_STABLE17.8REL_16_STABLE16.12REL_15_STABLE15.16REL_14_STABLE14.21
LLM analysis, 100% surewritten from the discussion, no matching patch1 of 1 reviewer saw the final version

Both attached versions preserve the incorrect LLVMBasicBlockRef * element type when converting b_checkargnulls in src/backend/jit/llvm/llvmjit_expr.c. After Michael reported compilation failure in #21, Thomas supplied the LLVMBasicBlockRef correction in #22; the commit implements that correction with ordinary palloc and an explicit cast.

  • Thomas Munrosaw the final versionLLM analysis, 100% sureThomas diagnosed the extra pointer level and proposed the corrected sizeof operand in #22, which Michael adopted in 06761b6096.
Use palloc_object() and palloc_array() in backend code
9 Dec 2025Michael Paquiermaster19beta1REL_19_STABLE19beta1
LLM analysis, 100% surepart of a posted patchsetmoderate changesfrom patchset #171 of 3 reviewers saw the final version

This extracts the backend portion of #17: 311 of its 333 changed files have identical whitespace-normalized changed lines, while other files receive cast cleanup, additional conversions or omissions described in #21. It also introduces palloc0_array for boundinfo->kind in partbounds.c where the attachment did not change the original non-zeroing allocation, and omits the failing LLVM conversion.

  • Tom Lanesaw an earlier versionLLM analysis, 85% sureTom warned about semantic changes in #8 and supported separating possible bugs in #15, but the backend batch subsequently gained additional allocation changes beyond that reviewed version.
  • Thomas Munrosaw an earlier versionLLM analysis, 86% sureThomas prompted the assembly-comparison validation in #12, but additional backend allocation changes followed and his specific LLVM diagnosis in #22 came after this commit.
  • Michael Paquiersaw the final versioncommittercommitted the patch
Use palloc_object() and palloc_array() in more areas of the tree
9 Dec 2025Michael Paquiermaster19beta1REL_19_STABLE19beta1
LLM analysis, 100% surepart of a posted patchsetlight changesfrom patchset #173 of 3 reviewers saw the final version

All 43 changed files match the corresponding whitespace-normalized changes in #17, covering utilities, common code, headers, procedural languages, tests and tutorials. This is only a subset of the submitted series; the dumputils.c conversion was left out, with Michael explaining his reservations in #21.

  • Tom Lanesaw the final versionLLM analysis, 83% sureTom supported isolating straightforward conversions from possible bug fixes in #15, and the selected conversions from #1 reached this batch without substantive edits.
  • Thomas Munrosaw the final versionLLM analysis, 88% sureThomas requested generated-code verification in #12, leading to the validation and split reported in #13 and #17, with these selected conversions subsequently unchanged.
  • Michael Paquiersaw the final versioncommittercommitted the patch
Use more palloc_object() and palloc_array() in contrib/
5 Dec 2025Michael Paquiermaster19beta1REL_19_STABLE19beta1
LLM analysis, 100% surepart of a posted patchsetlight changesfrom patchset #174 of 4 reviewers saw the final version

This extracts 67 contrib files from #17, with identical whitespace-normalized changes in 59 files. Michael removed redundant pgcrypto casts and omitted questionable btree_gist and erroneous sepgsql conversions, explaining those decisions in #18.

  • Chao Lisaw the final versionLLM analysis, 98% sureChao questioned the value of character-related conversions in #2, including the contrib/xml2/xslt_proc.c palloc_object(const char *) conversion that landed unchanged.
  • Tom Lanesaw the final versionLLM analysis, 96% sureTom explicitly supported the character-related conversions discussed in #8, including the xslt_proc.c change retained in this batch, while requesting scrutiny of arithmetic semantics.
  • Thomas Munrosaw the final versionLLM analysis, 87% sureThomas requested generated-code comparison in #12, which informed the split in #17 and the contrib validation Michael reported in #18.
  • Michael Paquiersaw the final versioncommittercommitted the patch

Credits across 7 commits

Author
David Geier6
Bertrand Drouvot1
Reviewer
Michael Paquiercommitter6
Committer
Michael Paquier7