Stuck with the error “pgAdmin connection to the server has been lost”? We can help you.
Often customers using PostgreSQL report to us that they get this error while trying to connect to PostgreSQL via pgAdmin.
Here at Bobcares, we often handle requests from our customers to fix similar PostgreSQL errors as a part of our Server Management Services. Today we will see how our support engineers fix this for our customers.
What causes pgAdmin “connection to the server has been lost” error?
Before going into the steps for fixing this error we will see what causes this error.
A typical error looks like the one given below.
Cause for the error
This error message indicates that the connection attempt has taken longer than the specified threshold; there may be a problem with the connection properties provided on the Server dialog, network connectivity issues, or the server may not be running.
Methods to fix pgAdmin “connection to the server has been lost”
Following are some of the methods that our support engineers use to fix this error for our customers.
1. Upgrade Pgadmin
We may get this error with pgadmin4 and it does not support PostgreSQL 9.
To fix this error we can upgrade to pgAdmin4 version 2.0.
We can do this from the URL given below:
2. Reconnect the connection
Another method to fix this error is to try reconnecting the connection.
We can do this with the following steps:
1. First select the database where the connection was lost.
2. Then select SQL
3. Now enter the image description here.
4. After that PgAdmin will ask us if we would like to reconnect to this database. Now enter image description and click ok
We will notice a message retrieving data from the server.
3. Restarting PostgreSQL
This error could also trigger when the PostgreSQL database is not working. However, we can fix this by restarting the service.
This can be done with the following command:
#sudo service postgresql restart
After restarting we can try reconnecting to PostgreSQL again.
[Still, stuck with the error? We can help you]
In short, we saw how our Support Techs fix pgAdmin “connection to the server has been lost” error for our customers.