Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oIItf-0001ST-F8 for pgsql-general@arkaria.postgresql.org; Mon, 01 Aug 2022 00:02:59 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oIItd-0003Tg-2G for pgsql-general@arkaria.postgresql.org; Mon, 01 Aug 2022 00:02:57 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oIItc-0003TX-Nj for pgsql-general@lists.postgresql.org; Mon, 01 Aug 2022 00:02:56 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oIIta-0000bE-FK for pgsql-general@lists.postgresql.org; Mon, 01 Aug 2022 00:02:55 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 27102q3R1504415; Sun, 31 Jul 2022 20:02:52 -0400 From: Tom Lane To: howardnews@selestial.com cc: Rob Sargent , pgsql-general@lists.postgresql.org Subject: Re: Connecting to postgres on OSX from Swift using PostgresClientKit In-reply-to: <55172d40109beb0daee6ad81a97352fe@selestial.com> References: <8b3c9c27-3a13-1a45-b3de-a995a4cbbf19@gmail.com> <55172d40109beb0daee6ad81a97352fe@selestial.com> Comments: In-reply-to howardnews@selestial.com message dated "Mon, 01 Aug 2022 00:53:59 +0100" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1504413.1659312172.1@sss.pgh.pa.us> Date: Sun, 31 Jul 2022 20:02:52 -0400 Message-ID: <1504414.1659312172@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk howardnews@selestial.com writes: > On 2022-07-31 23:42, Rob Sargent wrote: >> On 7/31/22 16:40, howardnews@selestial.com wrote: >>> I can successfully connect using psql and/pgadmin, but when I try >>> and connect in code I get the following error: >>> [Connection-1 Severe] Unable to connect socket: Error Code: >>> -9989(0x2705), Operation not permitted >> Maybe add config.host = "localhost"? > Thanks, tried localhost, 127.0.0.1 and ::128. No joy Don't know much about Swift, but it wouldn't surprise me if that code is running in some kind of sandbox that disallows IP connections by default. Also, does psql work when you say "psql -h localhost"? It's possible that your server isn't listening on localhost, or there's a firewall there. Your working connections could all be via Unix sockets, from what little you've said so far. regards, tom lane