Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id C1B03182B9 for ; Thu, 10 Nov 2011 10:51:24 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 02338-01 for ; Thu, 10 Nov 2011 14:51:15 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.8.0-rc2 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by mail.postgresql.org (Postfix) with ESMTP id AF66C182BE for ; Thu, 10 Nov 2011 10:51:12 -0400 (AST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id pAAEpA0W007445; Thu, 10 Nov 2011 09:51:12 -0500 (EST) To: "=?ISO-8859-1?B?ZGFmbG14?=" cc: pgsql-general@postgresql.org Subject: Re: In-reply-to: References: Comments: In-reply-to "=?ISO-8859-1?B?ZGFmbG14?=" message dated "Thu, 10 Nov 2011 15:54:06 +0800" Date: Thu, 10 Nov 2011 09:51:10 -0500 Message-ID: <7444.1320936670@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-3.101 tagged_above=-5 required=5 tests=BAYES_00=-1.9, RP_MATCHES_RCVD=-1.201 X-Spam-Level: X-Archive-Number: 201111/380 X-Sequence-Number: 181953 "=?ISO-8859-1?B?ZGFmbG14?=" 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