Jeff Davis <pgsql@xxxxxxxxxxx> writes: > I don't understand. CREATE INDEX CONCURRENTLY can't be run in a > transaction block anyway, so a REINDEX CONCURRENTLY wouldn't either. So > how (or when) would you deadlock? The problem is you need to upgrade from a nonexclusive table lock to an exclusive one before you could drop the old index. If someone else is waiting to get a conflicting lock, boom ... regards, tom lane