mirror of
https://github.com/postgres/postgres.git
synced 2025-12-15 02:22:24 +03:00
Prevent reindex of invalid indexes on TOAST tables
Such indexes can only be duplicated leftovers of a previously failed REINDEX CONCURRENTLY command, and a valid equivalent is guaranteed to exist. As toast indexes can only be dropped if invalid, reindexing these would lead to useless duplicated indexes that can't be dropped anymore, except if the parent relation is dropped. Thanks to Justin Pryzby for reminding that this problem was reported long ago during the review of the original patch of REINDEX CONCURRENTLY, but the issue was never addressed. Reported-by: Sergei Kornilov, Justin Pryzby Author: Julien Rouhaud Reviewed-by: Michael Paquier Discussion: https://postgr.es/m/36712441546604286%40sas1-890ba5c2334a.qloud-c.yandex.net Discussion: https://postgr.es/m/20200216190835.GA21832@telsasoft.com Backpatch-through: 12
This commit is contained in:
@@ -181,6 +181,7 @@ extern char *get_namespace_name_or_temp(Oid nspid);
|
||||
extern Oid get_range_subtype(Oid rangeOid);
|
||||
extern Oid get_range_collation(Oid rangeOid);
|
||||
extern Oid get_index_column_opclass(Oid index_oid, int attno);
|
||||
extern bool get_index_isvalid(Oid index_oid);
|
||||
|
||||
#define type_is_array(typid) (get_element_type(typid) != InvalidOid)
|
||||
/* type_is_array_domain accepts both plain arrays and domains over arrays */
|
||||
|
||||
Reference in New Issue
Block a user