Re: BUG #16086: Cannot connect using psql, however I can connect using pgadmin

From: Jeff Janes <jeff(dot)janes(at)gmail(dot)com>
To: PG Bug reporting form <noreply(at)postgresql(dot)org>
Cc: pgsql-bugs <pgsql-bugs(at)lists(dot)postgresql(dot)org>, mzwai99(at)outlook(dot)com
Subject: Re: BUG #16086: Cannot connect using psql, however I can connect using pgadmin
Date: 2019-10-29 11:27:17
Message-ID: CAMkU=1zrraUm9ySaooqm_8_aN4PxD7BeJdXW=NuF9R0vCeCUkw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

>
>
> LOG: listening on Unix socket "/u01/postgresql/.s.PGSQL.5437"
> LOG: listening on Unix socket "/tmp/.s.PGSQL.5437"
>

...

> [root(at)zardplpsmasdev01 ~]# su - postgres -c "psql"
> 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
> "/var/run/postgresql/.s.PGSQL.5432"?
>

You probably have multiple binaries installed coming from different
packages or package managers. psql is searching for the socket in one
place, which is not either of the two places the server is listening. You
could explicitly tell it where to connect with either `-h /tmp`, or `-h
127.0.0.1`. Or you could find the correct "psql" to run (the one that came
with the running server) so that it just knows where to look, possibly
uninstalling the wrong psql to minimize future confusion.

Cheers,

Jeff

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Ashutosh Sharma 2019-10-29 11:51:59 Re: BUG #16086: Cannot connect using psql, however I can connect using pgadmin
Previous Message Ashutosh Sharma 2019-10-29 11:23:10 Re: BUG #16084: Server couldn't be contacted