Book: Database Playbook
Also by me: Thinking in Go (2-book series) — Complete Guide to Go Programming + Hexagonal Architecture in Go
My project: Hermes IDE | GitHub — an IDE for developers who ship with Claude Code and other AI coding tools
Me: xgabriel.com | GitHub
You ask your coding agent for a unique index on users.email . It writes CREATE UNIQUE INDEX CONCURRENTLY , which is the right call on a live table. The deploy fails. The agent reruns the migration, gets told the index already exists, adds IF NOT EXISTS , and CI goes green. Weeks later someone runs \d users and sees the word INVALID at the end of the index line.
None of this is a bug. The Postgres CREATE INDEX docs say that if a concurrent build hits "a deadlock or a uniqueness violation in a unique index", the command fails "but leave[s] behind an 'invalid' index. This index will be ignored for querying purposes because it might be incomplete; however it will still consume update overhead."
Queries get nothing from it.…