Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1ghFGL-0005rX-FQ for pgsql-performance@arkaria.postgresql.org; Wed, 09 Jan 2019 14:55:21 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1ghFGH-00031e-E1 for pgsql-performance@arkaria.postgresql.org; Wed, 09 Jan 2019 14:55:17 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1ghFGH-00031X-6d for pgsql-performance@lists.postgresql.org; Wed, 09 Jan 2019 14:55:17 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1ghFG9-00022Z-Qd for pgsql-performance@lists.postgresql.org; Wed, 09 Jan 2019 14:55:16 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id x09Et2fH019154; Wed, 9 Jan 2019 09:55:02 -0500 From: Tom Lane To: Mariel Cherkassky cc: pgsql-performance@lists.postgresql.org Subject: Re: postgresql unix socket connections In-reply-to: References: Comments: In-reply-to Mariel Cherkassky message dated "Wed, 09 Jan 2019 10:35:41 +0200" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <19152.1547045702.1@sss.pgh.pa.us> Date: Wed, 09 Jan 2019 09:55:02 -0500 Message-ID: <19153.1547045702@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Mariel Cherkassky writes: > I'm trying to understand some issues that I'm having with the unix_socket > settings and pgsql. > I have 2 machines with pg v9.2.5 with the same next settings : > #listen_addresses = 'localhost' > #unix_socket_directory = '' This will result in the server creating the socket in whatever it thinks is the default socket directory. Traditionally PG uses /tmp as the default socket directory, and your netstat result is consistent with that: > unix 2 [ ACC ] STREAM LISTENING 51587140 3729/postgres > /tmp/.s.PGSQL.5432 However, this: > 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"? shows that your psql is using a libpq that thinks the default socket directory is /var/run/postgresql. That's a build-time option, and I recall that Red Hat builds their postgresql package that way. I'm not 100% sure which way the PGDG RPMs do it. You could override libpq's default, for instance via "psql -h /tmp". But probably you'd be better off removing any packages that provide libpq versions that don't match your server. Alternatively, you could configure the server to create socket files in both places. regards, tom lane