A corrective release for the PostgreSQL Database Management System 14.4 has been issued, addressing a serious issue that, under certain circumstances, leads to unnoticed data corruption in indexes when executing the "CREATE INDEX CONCURRENTLY" and "REINDEX CONCURRENTLY" commands. Some records may be overlooked in indexes created by these commands, resulting in the omission of individual rows during SELECT queries involving the problematic indexes.
To determine if there is B-tree index corruption, you can use the command "pg_amcheck --heapallindexed database_name". If errors are detected or if the "CREATE INDEX CONCURRENTLY" and "REINDEX CONCURRENTLY" commands with other index types (GiST, GIN, etc.) were used in previous releases, it is recommended to perform reindexing with the utility "reindexdb --all" or with the command "REINDEX CONCURRENTLY index_name" after upgrading to version 14.4.
The issue only affects the 14.x branch, which included optimizations that excluded certain transactions associated with the execution of "CREATE INDEX CONCURRENTLY" and "REINDEX CONCURRENTLY" during the VACUUM operation. As a result of these optimizations, some tuples in heap memory that were updated or truncated during index creation were excluded from indexes created in "CONCURRENTLY" mode.
Source: opennet.ru
