MP019CRITICALPro

no-exclusive-lock-high-connections

What It Detects

ACCESS EXCLUSIVE lock with many active connections (from pg_stat_activity).

Why It's Dangerous

When many connections are active on a table, acquiring ACCESS EXCLUSIVE causes all of them to queue up, creating a cascade of timeouts and connection pool exhaustion.

Bad Example

-- ACCESS EXCLUSIVE on table with 200+ active connections

Good Example

-- Use advisory locks or schedule during low-connection periods

Configuration

Disable this rule:

# .migrationpilotrc.yml
rules:
  MP019: false

Or change its severity:

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