"=?ISO-8859-1?B?ZGFmbG14?=" <daf...@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

-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

Reply via email to