In this article
Inspect definition, validity and readiness after a failed build; IF NOT EXISTS only handles name presence and cannot certify a repaired index.
The migration retry succeeds without fixing the index
A concurrent index build fails during a service migration. The next deployment uses IF NOT EXISTS and reports no creation error, so the team assumes the index is ready. The original named object can still be invalid.
The CREATE INDEX manual says that IF NOT EXISTS checks name presence without guaranteeing that the existing index resembles the requested one. This makes a clean rerun a weak acceptance signal after an interrupted or failed build.
Understand the intermediate catalog state
Concurrent construction spans multiple stages and transactions. PostgreSQL first creates catalog state and later performs the required scans and waits. Failure during this process can leave an index that is unsuitable for queries rather than removing every trace of the attempted operation.
The manual warns that such an invalid index can still impose update overhead. A query planner ignoring it is therefore not evidence that it has no effect on the service. Include the failed object in the resource and write-path investigation.
Separate validity from readiness
The index catalog reference defines validity for query use separately from readiness for insert and update maintenance. Record both alongside the actual index definition and target table.
Do not replace this inspection with an index-name list. Names can match while columns, predicate, expression or other properties differ. A state suitable for ongoing maintenance is also not automatically a state suitable for the intended read plan.
Review failed uniqueness behavior
The concurrent-build manual describes a particularly important unique-index case: uniqueness enforcement can begin before the index becomes available for queries. A failure during a later scan can leave an invalid index that continues enforcing uniqueness.
An application can consequently receive constraint errors while the expected query acceleration is absent. Do not classify that combination as impossible or automatically unrelated. Preserve the build phase and error history, and distinguish possible ongoing enforcement from proof that the entire intended uniqueness property was successfully validated.
Choose an explicit repair plan
The documented recovery choices include removing the failed object and retrying construction, or rebuilding through the supported concurrent reindex path. Review the exact object, dependencies and workload before changing it. These are potentially consequential schema operations, not harmless attempts to clear a warning.
Index resource planning explains the shared workload context. Stable operation outcomes helps distinguish a repeated migration request from evidence that its desired state was actually achieved.
Accept the resulting state and behavior
In an isolated fixture, trigger a controlled build failure, inspect the residue and exercise the chosen repair procedure. Verify the definition, catalog flags, intended query behavior and applicable write constraints afterward. Acceptance must describe the final state rather than only the migration process’s exit code. Preserve the failure evidence so an existing name cannot silently turn an incomplete index into a declared successful deployment.
Earn rental income from GPUs
Have idle GPUs or looking to fund AI infrastructure? Retrivium finds a rental platform, sets up the server and helps you assess income and costs with a pilot.