Re: Connecting to postgres on OSX from Swift using PostgresClientKit

Поиск
Список
Период
Сортировка
От howardnews@selestial.com
Тема Re: Connecting to postgres on OSX from Swift using PostgresClientKit
Дата
Msg-id 55172d40109beb0daee6ad81a97352fe@selestial.com
обсуждение исходный текст
Ответ на Re: Connecting to postgres on OSX from Swift using PostgresClientKit  (Rob Sargent <robjsargent@gmail.com>)
Ответы Re: Connecting to postgres on OSX from Swift using PostgresClientKit  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: Connecting to postgres on OSX from Swift using PostgresClientKit  (Adrian Klaver <adrian.klaver@aklaver.com>)
Список pgsql-general
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



В списке pgsql-general по дате отправления:

Предыдущее
От: Rob Sargent
Дата:
Сообщение: Re: Connecting to postgres on OSX from Swift using PostgresClientKit
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Connecting to postgres on OSX from Swift using PostgresClientKit