docs/reference/rules/require-concurrent-reindex.md
Diagnostic Category: lint/safety/requireConcurrentReindex
Since: vnext
[!NOTE] This rule is recommended. A diagnostic error will appear when linting your code.
Sources:
REINDEX without CONCURRENTLY acquires an ACCESS EXCLUSIVE lock on the table.
This blocks all reads and writes until the reindex completes. Use REINDEX CONCURRENTLY
to rebuild the index without blocking concurrent operations.
reindex index my_index;
code-block.sql:1:1 lint/safety/requireConcurrentReindex ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
! REINDEX without CONCURRENTLY blocks all table access.
> 1 │ reindex index my_index;
│ ^^^^^^^^^^^^^^^^^^^^^^^
2 │
i Use REINDEX CONCURRENTLY to rebuild the index without blocking reads and writes.
reindex index concurrently my_index;
{
"linter": {
"rules": {
"safety": {
"requireConcurrentReindex": "error"
}
}
}
}