Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rT742-000Vtp-4T for pgsql-general@arkaria.postgresql.org; Thu, 25 Jan 2024 21:15:10 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1rT741-004DAT-Dr for pgsql-general@arkaria.postgresql.org; Thu, 25 Jan 2024 21:15:09 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rT741-004D97-2l for pgsql-general@lists.postgresql.org; Thu, 25 Jan 2024 21:15:09 +0000 Received: from wout5-smtp.messagingengine.com ([64.147.123.21]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rT73y-003i9S-0b for pgsql-general@lists.postgresql.org; Thu, 25 Jan 2024 21:15:08 +0000 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.west.internal (Postfix) with ESMTP id 1501C3200B05; Thu, 25 Jan 2024 16:15:02 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Thu, 25 Jan 2024 16:15:03 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= cc:cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to; s=fm2; t=1706217302; x=1706303702; bh=x2KC27iA+0 iFJOLycMsALLxn/Cj3joa1dLcjtB7ifeU=; b=jzxI4Uk8083BMDtZ+o3aWgXDGa 8RkFBF2Y1gusqG+2+NQ7mQmaHp6V7ONq845426/e4Dy1JWWS7ZyJ09FLTUEeVVOs rVnU9qujiyuJqmhRWYA7UVzQdHBgtcOYbRn5cQVGBZuEqyqkAWQ30DEI6aBq6jQN fFnMSR0n7I3/zOG4ZJnpY07InriIJaMnCkCizsem8jrZoUjgoV8kcb9jH6mha+E7 l1zt9X6I/AIY0sJz5TD3DcA/Se76vUDyA13Czk0w4KR2gwCA1uXrsCofLUjoSUbS 53qNO6Ym/Y27U1eACU6+e+q74vOXCSZxk2+xdBOYl1gusthBAwceJxy8SdDw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; t=1706217302; x=1706303702; bh=x2KC27iA+0iFJOLycMsALLxn/Cj3 joa1dLcjtB7ifeU=; b=T5pWAmkQzUwydUclAOWT5EFOE8oBLp7zSk6Ql7UgxdBK voukFWVSU21rlCJVU8fgeBSO5ff438Yj0caNSOutUh70TGAd9FUNjQt/3+y1yIMJ AkbxWtV8i3DXuctC44Cya9D1WBE9j3ixEpoFv7HttkNSCisDllDfIzj7Z/hqz14T WAmk2Ztk5Iu1jfgxeR2PcMmR+iuYZtfaZiOQ6RJKgHNTN5bptOWRnY+x9p9HD0E/ 19Gdt1WkMLt42J5PvaMmnxMC+rIpjxIdAtwIPAlJgtxVZzbNcI+f6vBzrbyHij1S A7rzAqHAduVHGzsVGemyB3y+bM6NfUOid6bAs6xEnw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrvdelhedgheegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurheptgfkffggfgfuvfevfhfhjgesrgdtreertddvjeenucfhrhhomheptegurhhi rghnucfmlhgrvhgvrhcuoegrughrihgrnhdrkhhlrghvvghrsegrkhhlrghvvghrrdgtoh hmqeenucggtffrrghtthgvrhhnpedukeejgfdtfeekvefhueekvefhheefveefkeelvddv ffeukeekueeiieffudejteenucffohhmrghinhepphhoshhtghhrvghsqhhlrdhorhhgne cuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprggurhhi rghnrdhklhgrvhgvrhesrghklhgrvhgvrhdrtghomh X-ME-Proxy: Feedback-ID: i76984098:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 25 Jan 2024 16:15:00 -0500 (EST) Content-Type: multipart/alternative; boundary="------------7aVGxKX1c0T3ekEd7NOKUJsm" Message-ID: Date: Thu, 25 Jan 2024 13:14:58 -0800 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: permission denied on socket To: Ron Johnson Cc: Atul Kumar , pgsql-general References: Content-Language: en-US From: Adrian Klaver In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk This is a multi-part message in MIME format. --------------7aVGxKX1c0T3ekEd7NOKUJsm Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 1/25/24 12:39 PM, Ron Johnson wrote: > On Thu, Jan 25, 2024 at 3:32 PM Adrian Klaver > wrote: > [snip] > > Best guess is you are using a version of psql that is expecting the > socket to be somewhere else then where it actually is. > > > Is "permission denied" really the error you get when the socket does > not exist? > > Trying "psql --host=/var/run/foo" gave me "No such file or directory". The OP used: psql postgres In that case psql will use the default set when it is compiled against libpq which from here: https://www.postgresql.org/docs/16/libpq-connect.html#LIBPQ-PARAMKEYWORDS "... is to connect to a Unix-domain socket in |/tmp| (or whatever socket directory was specified when PostgreSQL was built)" If you have more then one instance of psql on a machine and they where built with different defaults you can end up not hitting the right socket. Also "permission denied" could be due to any part of the path /tmp/.s.PGSQL.5432. --------------7aVGxKX1c0T3ekEd7NOKUJsm Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit


On 1/25/24 12:39 PM, Ron Johnson wrote:
On Thu, Jan 25, 2024 at 3:32 PM Adrian Klaver <adrian.klaver@aklaver.com> wrote:
[snip]
Best guess is you are using a version of psql that is expecting the
socket to be somewhere else then where it actually is.

Is "permission denied" really the error you get when the socket does not exist?

Trying "psql --host=/var/run/foo" gave me "No such file or directory".


The OP used:

psql postgres

In that case psql will use the default set when it is compiled against libpq which from here:

https://www.postgresql.org/docs/16/libpq-connect.html#LIBPQ-PARAMKEYWORDS

"... is to connect to a Unix-domain socket in /tmp (or whatever socket directory was specified when PostgreSQL was built)"


If you have more then one instance of psql on a machine and they where built with different defaults you can 

end up not hitting the right socket.

Also "permission denied" could be due to any part of the path /tmp/.s.PGSQL.5432.


--------------7aVGxKX1c0T3ekEd7NOKUJsm--