Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PGAdmin: Not connected to the server or the connection to the server has been closed

i got this problem with postgreSQL, when i do a simple query of anything (CRUD), sometimes it works and almost always shows this message:

Not connected to the server or the connection to the server has been closed.

I don't know how to solve it and it started to irritate me, anyone know how to fix it?

UPDATE 1

I have been searching and it seems the pgadmin4 the problem (it seems because it's not 100% developed yet), i have been using pgadmin3 and that error doesn't show up.

like image 268
Jorge Avatar asked Dec 21 '16 15:12

Jorge


People also ask

Why is pgAdmin not connecting to server?

If pgAdmin displays this message, there are two possible reasons for this: the database server isn't running - simply start it. the server isn't configured to accept TCP/IP requests on the address shown.

How do I reconnect to my pgAdmin server?

Connect to Server¶ To access the dialog, right click on the server name in the pgAdmin tree control, and select Connect Server… from the context menu. Provide authentication information for the selected server: Use the Password field to provide the password of the user that is associated with the defined server.

How do I restart my pgAdmin server?

The recommended way to restart pgAdmin 4 is to quit the menulet pgAdmin 4 ("Shut down server") and launch pgAdmin 4 again from the Dock.


2 Answers

solution is:

select the database where you lost the connection.

then on the right hand side select SQL

For example in the picture (shopdb) is the db where I lost the connection to.

enter image description here After that PgAdmin will ask you if you would like to reconnect to this database... enter image description here click ok

you will notice a message retreiving data from the server

like image 50
WISAM Avatar answered Oct 21 '22 20:10

WISAM


The reason this happened for me was a syntax error in the query. Check your syntax and try again, maybe this suffices

like image 33
lucidbrot Avatar answered Oct 21 '22 18:10

lucidbrot