connection limit for role 🐘 PostgreSQL

FATAL: too many connections for role "x"

The role reached its per-role CONNECTION LIMIT (often set by hosting providers or free tiers).

Seen on: PostgreSQL

Meaning

Different from max_connections: this cap applies to one role. Free database tiers set small limits.

Common causes

  • Role connection limit reached
  • Pools too large for the plan
  • Leaked connections

⚡ Quick fix

  1. Reduce pool size
  2. Use the provider’s pooler
  3. Raise the role limit if you control it: ALTER ROLE app CONNECTION LIMIT 50

Detailed fix by platform

PostgreSQL

  1. SELECT rolname, rolconnlimit FROM pg_roles WHERE rolname = 'app';

How to diagnose

  1. Limit — rolconnlimit?
  2. Usage — count in pg_stat_activity

🧠 Still stuck? Analyze your error

Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.