MP033WARNINGAuto-fixableFree

require-concurrent-refresh-matview

What It Detects

REFRESH MATERIALIZED VIEW without CONCURRENTLY blocks all reads.

Why It's Dangerous

Without CONCURRENTLY, REFRESH acquires ACCESS EXCLUSIVE, blocking all queries against the materialized view for the entire refresh duration. With CONCURRENTLY, reads continue against the old data until refresh completes.

Bad Example

REFRESH MATERIALIZED VIEW mv_user_stats;

Good Example

REFRESH MATERIALIZED VIEW CONCURRENTLY mv_user_stats;

Auto-fix

Run migrationpilot analyze file.sql --fix to automatically fix this violation.

Configuration

Disable this rule:

# .migrationpilotrc.yml
rules:
  MP033: false

Or change its severity:

# .migrationpilotrc.yml
rules:
  MP033:
    severity: warning