FATAL: remaining connection slots are reserved for non-replication superuser connections

 

You will get this error when you reach the max connection count in PostgreSQL.

You need to increase the max connection count in the postgresql.conf file to fix the error.

You can learn the current max connection number by running the following command from the operating system.

 

You can use the following command to find out where the postgresql.conf file is. It is in the directory after -D.

 

After entering the relevant directory with the command “cd”, you should enter the postgresql.conf file with the command below.

 

After finding the max_connections parameter, we press the insert key from the keyboard and increment the value.

To save and exit, we press Esc, wq, Enter, respectively. Then we restart the PostgreSQL service.

You can read the article “How To Stop, Start, Restart and Reload PostgreSQL Service” to restart the PostgreSQL service.

If you increase the Max_Connection parameter too much, you may not be able to start the service due to an error like the one below.

 

FATAL: could not create semaphores: No space left on device 

 

You can read the article “FATAL: could not create semaphores: No space left on device” to solve this error.

dbtut
Author: dbtut

We are a team with over 10 years of database management and BI experience. Our Expertises: Oracle, SQL Server, PostgreSQL, MySQL, MongoDB, Elasticsearch, Kibana, Grafana.

Leave a Reply

Your email address will not be published. Required fields are marked *