The context
Sql
CREATE INDEX CONCURRENTLY idx_consentement_xxx ON consentement (colonne);
What went wrong
Diagnosis
Sql
SELECT pg_size_pretty(pg_database_size('nom_db'));
Sql
SELECT * FROM pg_stat_progress_create_index;
The main lesson
How to avoid it next time
- Check available disk space before any operation of this kind on a large table, with a comfortable margin
- Monitor pg_stat_progress_create_index during execution instead of launching the command and waiting passively
- Schedule it during a low-load window, even with CONCURRENTLY, to limit side effects
- Have a monitoring alert on remaining disk space, not just on CPU/memory load