Prompt
postgresql connection limit
Latest observation
Oct 7, 2026
OpenAI APIWeb search: off
In PostgreSQL, the connection limit is controlled by:
1) max_connections
This is the main server-wide setting that limits how many client connections PostgreSQL will accept at once.
SHOW max_connections;
You can also check:
SELECT current_setting('max_connections');
2) Per-database / per-role limits
PostgreSQL also supports limits for specific databases or users:
ALTER DATABASE mydb CONNECTION LIMIT 50;
ALTER ROLE myuser CONNECTION LIMIT 10;
Check them with:
\l
\du
3) Important note
max_connections is set in postgresql.conf and usually requires a server restart to change.
Example:
max_connections = 200
Then restart PostgreSQL.
4) If you need many app connections
If your app opens lots of connections, it’s common to use a pooler like PgBouncer instead of increasing max_connections too much.
If you want, I can also show:
- how to check current active connections
- how to increase the limit
- how to find what is consuming connections
Brands