Redrock Postgres Documentation
Home Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Back to homepage

53300 Too Many Connections

FATAL: sorry, too many clients already

You may encounter an error message like following.

FATAL: sorry, too many clients already

You have reached the default limit of 100 database sessions. At most max_connections connections can ever be active simultaneously, you need to modify the parameter value in the configuration file postgresql.conf, and restart the database service to update the configuration parameter.

FATAL: too many connections for database

You may encounter an error message like following.

FATAL: too many connections for database "mydb"

You have reached the limit on the number of connections to a database. Run the following SQL statement to query the maximum number of connections for the database:

SELECT datconnlimit FROM pg_database WHERE datname = 'mydb';

You can issue ALTER DATABASE CONNECTION LIMIT to change the limit.

ALTER DATABASE mydb CONNECTION LIMIT 100;

FATAL: too many connections for role

You may encounter an error message like following.

FATAL: too many connections for role "david"

You have reached the limit on the number of connections for a database role. Run the following SQL statement to query the maximum number of connections for the role:

SELECT rolconnlimit FROM pg_roles WHERE rolname = 'david';

You can issue ALTER ROLE CONNECTION LIMIT to change the limit.

ALTER ROLE david CONNECTION LIMIT 100;