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 1oIIl3-0000zg-B5 for pgsql-general@arkaria.postgresql.org; Sun, 31 Jul 2022 23:54:05 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oIIl2-00040C-0C for pgsql-general@arkaria.postgresql.org; Sun, 31 Jul 2022 23:54:04 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oIIl1-000402-Ic for pgsql-general@lists.postgresql.org; Sun, 31 Jul 2022 23:54:03 +0000 Received: from mail-falcon.ukwebsolutionsdirect.com ([193.189.75.23]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oIIkz-0005AH-Oe for pgsql-general@lists.postgresql.org; Sun, 31 Jul 2022 23:54:03 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=selestial.com; s=default; h=Content-Transfer-Encoding:Content-Type: Message-ID:References:In-Reply-To:Subject:Cc:To:From:Date:MIME-Version:Sender :Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=aLFtcaO6k5HgodhXqRbHV1MvVKdFejooVRIJkiHZldM=; b=B7LJY8zTUl8TwnHT7585ywzIS4 AEsUFgzHDHhhvWkpyZKGgyV0yi3cOnbsFZCp0KXSNZlNFMNt0OApktk1jndSiX03ABhWHwBljJAHf 6tDeccubT3DwQiOkxxKyNp2rY8wR9hoY9Gi52zw3jh3+0RYuyR9umVc1FDqOcng4oI5KPJfrZqYxF +BZ1H7IOcGtPmg7CSh4DGNqbQ5mPNk58yO1j5HJRGjacgORS7ddxHvBlhImNA+0Uw8PjU9zRdlJj3 qku/FuVj5pqhcUgZzDZGoalizJc4wV+dlHFFj0PwQJKPj4y9e6GpCO+FZts5KJcfZuecdPquATq2P 48K51ghQ==; Received: from [::1] (port=58112 helo=falcon.ukwebsolutionsdirect.com) by falcon.ukwebsolutionsdirect.com with esmtpa (Exim 4.95) (envelope-from ) id 1oIIky-004yGQ-2C; Mon, 01 Aug 2022 00:54:00 +0100 MIME-Version: 1.0 Date: Mon, 01 Aug 2022 00:53:59 +0100 From: howardnews@selestial.com To: Rob Sargent Cc: pgsql-general@lists.postgresql.org Subject: Re: Connecting to postgres on OSX from Swift using PostgresClientKit In-Reply-To: <8b3c9c27-3a13-1a45-b3de-a995a4cbbf19@gmail.com> References: <8b3c9c27-3a13-1a45-b3de-a995a4cbbf19@gmail.com> User-Agent: Roundcube Webmail/1.5.2 Message-ID: <55172d40109beb0daee6ad81a97352fe@selestial.com> X-Sender: howardnews@selestial.com Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - falcon.ukwebsolutionsdirect.com X-AntiAbuse: Original Domain - lists.postgresql.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - selestial.com X-Get-Message-Sender-Via: falcon.ukwebsolutionsdirect.com: authenticated_id: howardnews@selestial.com X-Authenticated-Sender: falcon.ukwebsolutionsdirect.com: howardnews@selestial.com List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2022-07-31 23:42, Rob Sargent wrote: > On 7/31/22 16:40, howardnews@selestial.com wrote: > >> Hi, >> >> Wondered if anyone had experience connection to pg14.1 running on >> OSX using the swift library PostgresClientKit. >> >> I am having difficulties connecting and hopefully someone can put me >> on the right track. >> >> The following is the swift code I am using >> >> [Code] >> var config = ConnectionConfiguration() >> config.database = "mydb" >> config.user = "postgres" >> config.credential = .scramSHA256(password: "mypassword") >> config.port = "5432" >> config.ssl = true >> let connection = try PostgresClientKit.Connection(configuration: >> config) >> defer { connection.close() } >> [/Code] >> >> I have the following in my pg_hba.conf file: >> >> [Code] >> local all all scram-sha-256 >> [/Code] >> >> I can successfully connect using psql and/pgadmin, but when I try >> and connect in code I get the following error: >> >> [Code] >> [Connection-1 Severe] Unable to connect socket: Error Code: >> -9989(0x2705), Operation not permitted >> [/Code] >> >> Any suggestions? >> >> Thanks >> >> Howard Cole >> Selestial.com > Maybe add config.host = "localhost"? Thanks, tried localhost, 127.0.0.1 and ::128. No joy