Re: BUG #16086: Cannot connect using psql, however I can connectusing pgadmin - Mailing list pgsql-bugs

From Ashutosh Sharma
Subject Re: BUG #16086: Cannot connect using psql, however I can connectusing pgadmin
Date
Msg-id CAE9k0Pm4XY3+gmWTZSKBxDHeefDOp=L3veJp094_VfsB4yrVrw@mail.gmail.com
Whole thread Raw
In response to Re: BUG #16086: Cannot connect using psql, however I can connectusing pgadmin  (Jeff Janes <jeff.janes@gmail.com>)
List pgsql-bugs
On Tue, Oct 29, 2019 at 4:57 PM Jeff Janes <jeff.janes@gmail.com> wrote:
>>
>>
>> LOG:  listening on Unix socket "/u01/postgresql/.s.PGSQL.5437"
>> LOG:  listening on Unix socket "/tmp/.s.PGSQL.5437"
>
>
> ...
>
>>
>> [root@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
forthe socket in one place, which is not either of the two places the server is listening.  You could explicitly tell
itwhere to connect with either `-h /tmp`, or `-h 127.0.0.1`.  Or you could find the correct "psql" to run (the one that
camewith the running server) so that it just knows where to look, possibly uninstalling the wrong psql to minimize
futureconfusion. 
>

Alternatively, you could also create a soft link to /tmp/.s.PGSQL.5432

ln -s /tmp/.s.PGSQL.5432 /var/run/postgresql/

Thanks,

--
With Regards,
Ashutosh Sharma
EnterpriseDB:http://www.enterprisedb.com



pgsql-bugs by date:

Previous
From: Jeff Janes
Date:
Subject: Re: BUG #16086: Cannot connect using psql, however I can connectusing pgadmin
Next
From: Muziwandile Zwane
Date:
Subject: Re: BUG #16086: Cannot connect using psql, however I can connectusing pgadmin