Re: Connecting to postgres on OSX from Swift using PostgresClientKit

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: howardnews(at)selestial(dot)com
Cc: Rob Sargent <robjsargent(at)gmail(dot)com>, pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: Connecting to postgres on OSX from Swift using PostgresClientKit
Date: 2022-08-01 00:02:52
Message-ID: 1504414.1659312172@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

howardnews(at)selestial(dot)com writes:
> On 2022-07-31 23:42, Rob Sargent wrote:
>> On 7/31/22 16:40, howardnews(at)selestial(dot)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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2022-08-01 00:04:14 Re: Connecting to postgres on OSX from Swift using PostgresClientKit
Previous Message howardnews 2022-07-31 23:53:59 Re: Connecting to postgres on OSX from Swift using PostgresClientKit