From: Tom Lane <tgl@sss.pgh.pa.us>
To: daflmx <daflmx@qq.com>
Cc: pgsql-general@postgresql.org
Subject: Re:
Date: Thu, 10 Nov 2011 09:51:10 -0500
Message-ID: <7444.1320936670@sss.pgh.pa.us> (raw)
In-Reply-To: <tencent_3914DB200606C8DF39FAB52E@qq.com>
References: <tencent_3914DB200606C8DF39FAB52E@qq.com>
"=?ISO-8859-1?B?ZGFmbG14?=" <daflmx@qq.com> writes:
> [ server is running but ]
> $/usr/local/pgsql/bin/createdb mydb
> createdb:could nto connect to database postgres: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"?
That last line shows that psql (or more specifically, the libpq.so
shared library) thinks it should connect to a local socket file at
/var/run/postgresql/.s.PGSQL.5432. However, the common location
for Postgres' local socket file is /tmp/.s.PGSQL.5432. I suspect
if you look in /tmp, you'll find that the server did create a
socket file there.
In short: this problem occurs because you have a postmaster built one
way and a client library built for a different convention. You could
force things with the -h switch to psql, but it would be more convenient
to be using postmaster and client library from the same distribution.
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: tgl@sss.pgh.pa.us, daflmx@qq.com
Subject: Re:
In-Reply-To: <7444.1320936670@sss.pgh.pa.us>
References: <tencent_3914DB200606C8DF39FAB52E@qq.com> <7444.1320936670@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