A concurrent PostgreSQL index build can fail without making the index name disappear. That makes an existence check misleading: a catalog row may remain even though PostgreSQL cannot use the index for query planning.
The implementation queries pg_index for one named index relation and joins pg_class to return readable index and table names. It interprets four catalog booleans instead of collapsing them into one “healthy” result.
The key decision is to separate write maintenance from query use. indisready answers whether inserts and updates should maintain the index. indisvalid answers whether PostgreSQL can use it for queries. A live index with indisready true and indisvalid false is therefore classified as an invalid leftover: it can still impose write overhead while remaining ineligible for plans.
The interpretation starts with indislive . A false value means the index is being dropped, so it should not be reported as an active failed build. For a live index, false indisvalid becomes invalid-leftover .…