pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Rob Sargent <robjsargent@gmail.com>
To: pgsql-general@lists.postgresql.org
Subject: Re: Connecting to postgres on OSX from Swift using PostgresClientKit
Date: Sun, 31 Jul 2022 16:42:54 -0600
Message-ID: <8b3c9c27-3a13-1a45-b3de-a995a4cbbf19@gmail.com> (raw)
In-Reply-To: <ee4efe672cd7b7909c68caf8a82c3ba9@selestial.com>
References: <ee4efe672cd7b7909c68caf8a82c3ba9@selestial.com>

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"?

view thread (11+ messages)  latest in thread

Message-ID: <8b3c9c27-3a13-1a45-b3de-a995a4cbbf19@gmail.com>
Permalink:  ../8b3c9c27-3a13-1a45-b3de-a995a4cbbf19@gmail.com/
Also on:    postgresql.org/message-id/8b3c9c27-3a13-1a45-b3de-a995a4cbbf19@gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: robjsargent@gmail.com
  Subject: Re: Connecting to postgres on OSX from Swift using PostgresClientKit
  In-Reply-To: <8b3c9c27-3a13-1a45-b3de-a995a4cbbf19@gmail.com>
  References: <ee4efe672cd7b7909c68caf8a82c3ba9@selestial.com> <8b3c9c27-3a13-1a45-b3de-a995a4cbbf19@gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox