diff --git a/NEWS b/NEWS index 3ee7dcb..6941dc1 100644 --- a/NEWS +++ b/NEWS @@ -52,6 +52,14 @@ Bug fixes Like with other functions of this extension, the SUPERUSER role attribute is not needed for execution. The REPLICATION attribute is sufficient. +4. Update BRIN indexes when appropriate. + + If a row was updated during the table processing and only the attributes of + "summarizing" (BRIN) indexes changed, pg_squeeze might fail to update those + indexes. + + This bug only affects pg_squeeze on PostgreSQL 16. + Release 1.6.1 ============= diff --git a/concurrent.c b/concurrent.c index 6607a23..96b5a56 100644 --- a/concurrent.c +++ b/concurrent.c @@ -416,7 +416,21 @@ apply_concurrent_changes(DecodingOutputState *dstate, Relation relation, &update_indexes #endif ); + /* + * In PG < 16, change of any indexed attribute makes HOT + * impossible, Therefore HOT update implies that no index + * needs to be updated. + * + * In PG >= 16, if only attributes of "summarizing indexes" + * change, HOT update is still possible. Therefore HOT update + * might still require some indexes (in particular, the + * summarizing ones) to be updated. + */ +#if PG_VERSION_NUM >= 160000 + if (update_indexes != TU_None) +#else if (!HeapTupleIsHeapOnly(tup)) +#endif { List *recheck;