mirror of
https://github.com/postgres/postgres.git
synced 2025-11-24 00:23:06 +03:00
Preserve pg_index.indisclustered across REINDEX CONCURRENTLY
If the flag value is lost, a CLUSTER query following REINDEX CONCURRENTLY could fail. Non-concurrent REINDEX is already handling this case consistently. Author: Justin Pryzby Discussion: https://postgr.es/m/20200229024202.GH29456@telsasoft.com Backpatch-through: 12
This commit is contained in:
@@ -1527,7 +1527,13 @@ index_concurrently_swap(Oid newIndexId, Oid oldIndexId, const char *oldName)
|
||||
newIndexForm->indimmediate = oldIndexForm->indimmediate;
|
||||
oldIndexForm->indimmediate = true;
|
||||
|
||||
/* Mark old index as valid and new as invalid as index_set_state_flags */
|
||||
/* Preserve indisclustered in the new index */
|
||||
newIndexForm->indisclustered = oldIndexForm->indisclustered;
|
||||
|
||||
/*
|
||||
* Mark the old index as valid, and the new index as invalid similarly
|
||||
* to what index_set_state_flags() does.
|
||||
*/
|
||||
newIndexForm->indisvalid = true;
|
||||
oldIndexForm->indisvalid = false;
|
||||
oldIndexForm->indisclustered = false;
|
||||
|
||||
Reference in New Issue
Block a user