Re: Connecting to postgres on OSX from Swift using PostgresClientKit - Mailing list pgsql-general

From Tom Lane
Subject Re: Connecting to postgres on OSX from Swift using PostgresClientKit
Date
Msg-id 1504414.1659312172@sss.pgh.pa.us
Whole thread Raw
In response to Re: Connecting to postgres on OSX from Swift using PostgresClientKit  (howardnews@selestial.com)
Responses Re: Connecting to postgres on OSX from Swift using PostgresClientKit
List pgsql-general
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



pgsql-general by date:

Previous
From: howardnews@selestial.com
Date:
Subject: Re: Connecting to postgres on OSX from Swift using PostgresClientKit
Next
From: Adrian Klaver
Date:
Subject: Re: Connecting to postgres on OSX from Swift using PostgresClientKit