简体   繁体   中英

Cannot connect to Postgres server when using latest version of Postgresql psql client tool

When I have the latest version of Postgresql (version 12) installed through brew and try to query a cloud hosted database using psql from the zsh shell, I receive the following error: psql: error: could not connect to server: could not connect to server: No such file or directory Is the server running locally and accepting connections on Unix domain socket "/tmp/.s.PGSQL.5432"?

When I use postgresql version 11, I can query the database.

Other developers on my team can query the same database using the latest version of Postgresql (version 12).

Any ideas as to what's wrong?

It sounds like you're connecting differently using v12 vs v11 (different shell, different host, different install method, something?) but without knowing the full connection command and/or environment info, this would be difficult to troubleshoot. Since your coworkers can connect with v12, it's not an issue with that. Since you really need more of a support forum, I'd probably recommend taking this question to the postgres slack or postgres mailing lists.

I solved the connection problem by uninstalling all brew packages, uninstalling brew, reinstalling brew and then reinstalling all the packages including postgresql version 12. After this, I could connect to the databases.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM