pgsql: Ensure we have a snapshot when updating pg_index in index_drop() - Mailing list pgsql-committers

From Nathan Bossart
Subject pgsql: Ensure we have a snapshot when updating pg_index in index_drop()
Date
Msg-id E1t5XYO-002uBV-JN@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
Ensure we have a snapshot when updating pg_index in index_drop().

I assumed that all index_drop() callers set an active snapshot
beforehand, but that is evidently not true.  One counterexample is
autovacuum, which doesn't set an active snapshot when cleaning up
orphan temp indexes.  To fix, unconditionally push an active
snapshot before updating pg_index in index_drop().

Oversight in commit b52adbad46.

Reported-by: Masahiko Sawada
Reviewed-by: Stepan Neretin, Masahiko Sawada
Discussion: https://postgr.es/m/CAD21AoBgF9etQrXbN9or_YHsmBRJHHNUEkhHp9rGK9CyQv5aTQ%40mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/70b9adb98eab42bc12ddeea863be335b21b55675

Modified Files
--------------
src/backend/catalog/index.c | 11 +++--------
1 file changed, 3 insertions(+), 8 deletions(-)


pgsql-committers by date:

Previous
From: Tom Lane
Date:
Subject: pgsql: Guard against enormously long input in pg_saslprep().
Next
From: Michael Paquier
Date:
Subject: pgsql: Fix dependency of partitioned table and table AM with CREATE TAB