From: Tom Lane <tgl@sss.pgh.pa.us>
To: pavan95 <pavan.postgresdba@gmail.com>
Cc: pgsql-admin@postgresql.org
Subject: Re: Error when starting postgres database!!
Date: Tue, 09 Oct 2018 00:38:21 -0400
Message-ID: <3190.1539059901@sss.pgh.pa.us> (raw)
In-Reply-To: <1539058967018-0.post@n3.nabble.com>
References: <1539058967018-0.post@n3.nabble.com>
pavan95 <pavan.postgresdba@gmail.com> writes:
> I'm facing an error in starting my postgresql database. The error is as
> shown below:
> bash-4.1$ psql
> psql: 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"?
Note the error message: it mentions the Unix socket location
"/var/run/postgresql/.s.PGSQL.5432". This means the psql (or
more precisely, libpq.so) that you're using thinks that PG
socket files live in /var/run/postgresql. That is *not* standard;
as shipped by the community, PG puts its socket files in "/tmp".
However, various distros think that is bad style and override
the build option to put the socket files elsewhere, most often
/var/run/postgresql.
In short, you are probably using a vendor-supplied libpq to
try to talk to a PG server that was built from unmodified
community code. You could confirm the latter by looking to see
if there's a /tmp/.s.PGSQL.5432 socket file.
You could use "psql -h /tmp" to override libpq's idea of the
socket location, or use "psql -h localhost" to forget about
socket files and connect via TCP, or change the server's
unix_socket_directories parameter to make it create a socket
(or additional socket) in /var/run/postgresql, or replace
either your libpq or your server with something that's got
the same built-in default location as the other end.
regards, tom lane
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-admin@postgresql.org
Cc: tgl@sss.pgh.pa.us, pavan.postgresdba@gmail.com
Subject: Re: Error when starting postgres database!!
In-Reply-To: <3190.1539059901@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox