SKY-Q507 · Quality, structure and performance
Unsupported concurrent PostgreSQL index drop
Medium
The script uses DROP INDEX CONCURRENTLY with more than one index or with CASCADE. PostgreSQL accepts a single index with the default RESTRICT behavior.
- Languages
- PostgreSQL
- Quality gate
- listed, not counted by the gate (full and diff scans). This PostgreSQL finding is report-only.
- Finding type
- review
Why it matters
A migration that groups indexes or requests automatic dependency removal fails at this statement.
What Skylos flags
DROP INDEX CONCURRENTLY orders_id, orders_status;[tool.skylos.sql]dialect = "postgresql"What Skylos leaves alone
DROP INDEX CONCURRENTLY orders_id;DROP INDEX CONCURRENTLY orders_status;Why Skylos leaves it alone
Handle each index separately. Inspect its dependencies before planning any removal.
How Skylos decides
- Skylos checks the index list and drop behavior on the parsed command.
- It reports one finding when both restrictions apply.
How to fix it
Handle each index separately. Inspect its dependencies before planning any removal.
Removed: DROP INDEX CONCURRENTLY orders_id, orders_status;Added: DROP INDEX CONCURRENTLY orders_id;Added: DROP INDEX CONCURRENTLY orders_status;When it can be wrong
- Ordinary DROP INDEX follows different rules. Database ownership and live dependencies also affect execution.
Seeing a case that isn't listed here? Report the wrong result so the rule can be fixed. Don't paste company code: describe the shape of it.
How to silence it
Review the statement in the context of its migration.