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 1oIHeJ-0006YO-LK for pgsql-general@arkaria.postgresql.org; Sun, 31 Jul 2022 22:43:03 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oIHeI-0005zr-KX for pgsql-general@arkaria.postgresql.org; Sun, 31 Jul 2022 22:43:02 +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 1oIHeI-0005zi-87 for pgsql-general@lists.postgresql.org; Sun, 31 Jul 2022 22:43:02 +0000 Received: from mail-pj1-x1036.google.com ([2607:f8b0:4864:20::1036]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1oIHeG-0008M0-7X for pgsql-general@lists.postgresql.org; Sun, 31 Jul 2022 22:43:01 +0000 Received: by mail-pj1-x1036.google.com with SMTP id e8-20020a17090a280800b001f2fef7886eso10147761pjd.3 for ; Sun, 31 Jul 2022 15:43:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=in-reply-to:from:references:to:content-language:subject:user-agent :mime-version:date:message-id:from:to:cc; bh=S7OVuZte0jfOUvorM0aj6v1Jpm9fAkqGRiW8eg1BfFo=; b=R9uI3KKNKzwueTw66m7/Gx0rc9hnk2whSO2q3OIgBb07OfZIuslRKSRX/vkSLdVRJr C1poFO8XAIDGJ8C6aaPeuaBG02F3bXU8L9c3kLGLCIX1pDkphBEobbPptfSFRXuujKLL P/Pvd+PST5i0BG7THA0lagV8Nh0tXxw0eKTME6CdLAxAw9wAes+NfPKGw19XyWf2bz/c hnCcClWiy+/rEE44HaltxlwC49KRHUBqvkvIBeNe6AkrTmBn2QOlO4YoTA0GlnOSrTzP sf+uOIqKOCphSnUnCUrSSMx3GX/nGDtrhffsZW/liEiDNUXOvu6tagCK9QeLxcEYnewg pX5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:from:references:to:content-language:subject:user-agent :mime-version:date:message-id:x-gm-message-state:from:to:cc; bh=S7OVuZte0jfOUvorM0aj6v1Jpm9fAkqGRiW8eg1BfFo=; b=GPlbhNIA4TQGNOmBK/YuWBR+T5zheZnyDAt/PKgmnUCxIwGNJvw37tdAHqgoCuX2Re lxuMVJ8r0Q8CN6mazpEkTOwGDGYgHUcAjNxFHO4JqhShX8FZRmWZgmd8xsz5Ciuf/abm 55DISplHm6pch2IvPbwvZd854zvi1WNd5xsEQcTO3k2WPZXCkFIXr1DgMm6MmuP0mniP 5+B/UBXHVBNUpNy8CHw/wHQSBfCZLPPxwUKx3vWtg06nZw2VCR51YfX0FVJKycMM33mf vsF4PsIhKpkpP+THnH/snylwrQC/zq6ps/oyg/hjIZGoCs44PgbZrEeKqzdhQSAQFDRt 8lsA== X-Gm-Message-State: ACgBeo1OU3l7g7lFQ2NWm9V/3JcJOpNyRbxpEjICLyKJ9e67EsvaiGQf Cn6c8CLRLJS4juTPGzeZJ/49Ho3T+Fw= X-Google-Smtp-Source: AA6agR6jgwN0rWU7OzE1aRnq3oGUFMjjqGwKPLansBo//vb62Rwr/k6d/Zrl+fhCZCe7rry47003aQ== X-Received: by 2002:a17:90a:9ce:b0:1f3:c90:6e99 with SMTP id 72-20020a17090a09ce00b001f30c906e99mr16796141pjo.211.1659307378286; Sun, 31 Jul 2022 15:42:58 -0700 (PDT) Received: from [10.128.56.11] ([155.98.131.3]) by smtp.gmail.com with ESMTPSA id z3-20020a170903018300b0016cdefd5e95sm8129068plg.8.2022.07.31.15.42.56 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 31 Jul 2022 15:42:56 -0700 (PDT) Content-Type: multipart/alternative; boundary="------------CbhY601v6rCs8GyeHton6PLn" Message-ID: <8b3c9c27-3a13-1a45-b3de-a995a4cbbf19@gmail.com> Date: Sun, 31 Jul 2022 16:42:54 -0600 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Subject: Re: Connecting to postgres on OSX from Swift using PostgresClientKit Content-Language: en-CA To: pgsql-general@lists.postgresql.org References: From: Rob Sargent 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. --------------CbhY601v6rCs8GyeHton6PLn Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit 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"? --------------CbhY601v6rCs8GyeHton6PLn Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit
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"?

--------------CbhY601v6rCs8GyeHton6PLn--