From d2fdc1b3ccbfc1b28abf0c0a3cbe36808c7223b6 Mon Sep 17 00:00:00 2001 From: Zoran Cvetkov Date: Fri, 14 Jun 2024 16:16:37 +0300 Subject: [PATCH] remove check for indisready flag --- store/postgres/src/relational/index.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/store/postgres/src/relational/index.rs b/store/postgres/src/relational/index.rs index cea76666932..a66b39a249e 100644 --- a/store/postgres/src/relational/index.rs +++ b/store/postgres/src/relational/index.rs @@ -802,8 +802,7 @@ impl IndexList { if let Some(index_name) = ind_name { let table_name = table.name.clone(); let query = r#" - SELECT x.indisvalid AS isvalid, - x.indisready AS isready + SELECT x.indisvalid AS isvalid FROM pg_index x JOIN pg_class c ON c.oid = x.indrelid JOIN pg_class i ON i.oid = x.indexrelid @@ -822,7 +821,8 @@ impl IndexList { .map(|ii| ii.into()) .collect::>(); assert!(ii_vec.len() <= 1); - if ii_vec.len() == 0 || !ii_vec[0].isvalid || !ii_vec[0].isready { + if ii_vec.len() == 0 || !ii_vec[0].isvalid { + // if a bad index exist lets first drop it if ii_vec.len() > 0 { let drop_query = sql_query(format!( "DROP INDEX {}.{};",