From 83088d79d6d7ecb998070afa06bcce30ebe33a4d Mon Sep 17 00:00:00 2001 From: Shihao Zhong Date: Sat, 31 Oct 2026 22:52:18 -0400 Subject: [PATCH v1] doc: Add PG 19 migration note about bpchar index deduplication. Commit 18740523a4a stopped nbtree deduplication for bpchar indexes, but indexes built by earlier major versions keep the old allequalimage flag. pg_upgrade does not rebuild them, and pg_upgrade --check does not warn about them, so amcheck reports them until they are rebuilt, and an index-only scan can return a value that differs from the heap in trailing spaces. Tell users to REINDEX them after upgrading. Discussion: https://postgr.es/m/CAGRkXqQQ311Lg=62x5UdZtPuRFgpT6XpPMw4X9E3tgbTu162Mw@mail.gmail.com --- doc/src/sgml/release-19.sgml | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/doc/src/sgml/release-19.sgml b/doc/src/sgml/release-19.sgml index 253fa07179a..91eb2a3aae3 100644 --- a/doc/src/sgml/release-19.sgml +++ b/doc/src/sgml/release-19.sgml @@ -431,6 +431,38 @@ recommended to reindex any indexes that use these functions after the upgrade. + + + + +Disable B-tree deduplication for +indexes on character (bpchar) columns +(Shihao Zhong, Peter Geoghegan) +§ + + + +Values of character that differ only in trailing spaces compare +as equal but are stored differently, so deduplication could make an index-only +scan return a value other than the one in the table. Indexes built by earlier +major versions still claim to support deduplication, and +pg_upgrade does +not change that. After upgrading, run REINDEX on every +B-tree index on a character column, including +character(n) columns and indexes +that use bpchar_pattern_ops. + reports such indexes until they are rebuilt. + + + +The same applies to B-tree indexes on oidvector columns, which +are rarely used outside the system catalogs. + + +