]> git.ipfire.org Git - thirdparty/postgresql.git/commit
amcheck: Fix snapshot usage in bt_index_parent_check
authorÁlvaro Herrera <alvherre@kurilemu.de>
Thu, 4 Dec 2025 17:12:08 +0000 (18:12 +0100)
committerÁlvaro Herrera <alvherre@kurilemu.de>
Thu, 4 Dec 2025 17:12:08 +0000 (18:12 +0100)
commitce2f575b7cf4ac9dbebed4df226b7de64c7d340d
tree4337bfee85bf2dcce54bcf024705da1fa789403b
parent8ba61bc06386b6c09fb9943a95dce973ea1c7b1d
amcheck: Fix snapshot usage in bt_index_parent_check

We were using SnapshotAny to do some index checks, but that's wrong and
causes spurious errors when used on indexes created by CREATE INDEX
CONCURRENTLY.  Fix it to use an MVCC snapshot, and add a test for it.

This problem came in with commit 5ae2087202af, which introduced
uniqueness check.  Backpatch to 17.

Author: Mihail Nikalayeu <mihailnikalayeu@gmail.com>
Reviewed-by: Andrey Borodin <x4mmm@yandex-team.ru>
Backpatch-through: 17
Discussion: https://postgr.es/m/CANtu0ojmVd27fEhfpST7RG2KZvwkX=dMyKUqg0KM87FkOSdz8Q@mail.gmail.com
contrib/amcheck/t/002_cic.pl
contrib/amcheck/verify_nbtree.c
doc/src/sgml/amcheck.sgml