Re: Unable to connect Postgres using psql while postgres is already running.

From: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
To: Dinesh Chandra 12108 <Dinesh(dot)Chandra(at)cyient(dot)com>, "pgsql-performance(at)postgresql(dot)org" <pgsql-performance(at)postgresql(dot)org>
Subject: Re: Unable to connect Postgres using psql while postgres is already running.
Date: 2018-01-10 09:10:58
Message-ID: 1515575458.2848.24.camel@cybertec.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Dinesh Chandra 12108 wrote:
> After restarting PostgreSQL Server, I am unable to connect postgres from putty, I am getting error
>
> psql: 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"?
>
> While postgres is already running and also I am able to connect databases from PGAdmin tool but not from command prompt.

You know that a local connection only works when you are logged in
on the database machine, right?

Is your database listening on port 5432?

Connect as user "postgres" and run the following queries:

SHOW port;
SHOW unix_socket_directories;

That will show the port and the directories where UNIX sockets are created.

You can use a socket directory name with the -h option of psql.

Yours,
Laurenz Albe

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Laurenz Albe 2018-01-10 10:41:04 Re: View preformance oracle to postgresql
Previous Message Dinesh Chandra 12108 2018-01-10 09:01:24 Unable to connect Postgres using psql while postgres is already running.