model-writtenrun 5852 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Alexander Lakhin reported that btree_gist index-only scans returned char(32) values without padding, producing four-byte results where ordinary index scans returned 32 bytes #1.
- Tom Lane traced the problem to trimming in gbt_bpchar_compress and proposed either disabling index-only scans or preserving padding with adjusted comparisons; reconstructing padding during fetch lacked necessary information #2. Alexander preferred preserving index-only scans and documenting the need to REINDEX existing indexes #3.
- Japin Li demonstrated that simply removing trimming broke equality searches #4; Tom explained that comparisons must ignore trailing spaces in both inputs #5, and Japin tested an inline trimming-based fix while supporting type-specific comparisons as the better approach #6.
- Tom submitted a patch preserving stored padding and using bpchar-specific comparison callbacks, but requested compatibility testing because gbt_text_same would still distinguish differently padded values in existing indexes; changing that function binding would require an extension version bump #7. Japin reviewed the patch favorably #8.
- Alexander confirmed that REINDEX after upgrade corrected stored values and found no query-result anomalies from the stricter equality function, even when forcing equality checks to return false; broader testing exposed only a predicate-locking test difference associated with changed page splits #10.
- Tom concluded that stricter equality could at worst cause unnecessary node splits and announced he would push the patch #11. The unchanged patch from #7 landed as 54b1cb7eb7, with backports to all supported branches; existing indexes require REINDEX for immediate correction of previously trimmed entries.