While opening query tool via pgadmin, i am getting this error on popup.

could not send data to server: Socket is not connected could not send SSL negotiation packet: Socket is not connected

Does any one know why this is happening.

2 Answers 2


try changing your host connection to "" instead of "localhost" it worked for me

  • 1
    If your local resolution makes localhost not resolve to, you have a big problem on your hand as almost everything running out there is excepting this name resolution. Commented Feb 20, 2020 at 18:45
  • 6
    @PatrickMevzek, localhost also resolves to the IPv6 loopback address ::1, while postgres might be configured to listen on only. Commented Feb 20, 2020 at 20:42
  • 2
    Thanks! This bug is ridiculous. I could see everything about my db but not the rows of tables. Commented May 19, 2020 at 14:52
  • @CharmingRobot, you're welcome, hahaha yes it is
    – Aya Hayder
    Commented May 19, 2020 at 15:27
  • This worked for me. The interesting this is was assigned to Kubernetes when I enabled docker. Is this by design?
    – Navap
    Commented Nov 23, 2021 at 14:00

You might consider that another app is using the socket. Or the postgres pg_hba.conf needs to be modified to allow non-local access.

  • Can you provide me the modifications needs to be done in the pg_hba.conf file? Commented Feb 5, 2020 at 11:13
  • Every situation has different details on IP address ranges and such. Please review this page: postgresql.org/docs/current/auth-pg-hba-conf.html After that, please post again if you have questions.
    – Mophilly
    Commented Feb 6, 2020 at 17:04

Not the answer you're looking for? Browse other questions tagged .