Libpq functions & string to obtain connection parameters

From: arnaud gaboury <arnaud(dot)gaboury(at)gmail(dot)com>
To: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Libpq functions & string to obtain connection parameters
Date: 2016-10-07 13:01:19
Message-ID: CAK1hC9srF0boV90sXCJK1Gu2+jKCrvnGRrMRMQYDrCV3CGbtkA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I start an app which use a libpq function to read connection params in a
URI. Until now, the app was using a tcp connection to connect to postgresql
with this URI:

postgres://
mmuser:mmuser_password(at)10(dot)10(dot)10(dot)1:5432/mattermost?sslmode=disable&connect_timeout=10

I want to switch and make the app connect to the unix socket instead. I am
trying to figure out what would then be the correct URI, with no luck until
now.

----------------------------
1- I modified the pg_hba.conf this way:

local mattermost mmuser peer
map=mattermap
-----------------
2- I modified pg_ident.conf this way:

mattermap mattermost mmuser
----------------------------------

3- I changed the URI this way:

postgres:/mmuser:PrOOt34/mattermost?connect_timeout=10

(NB: do I have to write in the URI the mmuser postgresql password, or Unix
user password?)

I recieve an error:
Failed to ping db err:pq: SSL is not enabled on the server

sslmode is ignored for Unix domain socket communication, so why this error?
I suspect my URI is not writen properly, but after many tries, I can't find
a working one.
Thank you for help.

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Andreas Kretschmer 2016-10-07 13:13:18 Re: Libpq functions & string to obtain connection parameters
Previous Message Rakesh Kumar 2016-10-07 12:29:18 pgpool question