I tried to pass the URL as "postgresql://localhost/emp_ame?user=empameuser&unix_socket=/tmp”, it did not connect to the pool. The goal is that I don’t want to pass password.
I tried to connect localhost via UNIX doamin using psycopg2, it works; I tried to set same properties in Django’s setting.py, it works as well.
With psycopg2: if host in ('localhost', '127.0.0.1') : return psycopg2.connect("host=/tmp dbname=%s user=empvocuser" % (database))
In Django:
ATABASES = { 'default': { 'ENGINE': 'django.db.backends.postgresql_psycopg2', 'NAME': 'emp_ame', 'USER': 'empameuser', 'HOST': '/tmp', }
On 4/8/16, 5:26 PM, "Jan-Henrik Haukeland" <hauk@tildeslash.commailto:hauk@tildeslash.com> wrote:
If you try, do you get an error message? You do? well there is your answer.
On 08 Apr 2016, at 22:49, Vicki Ma <vma@akamai.commailto:vma@akamai.com> wrote: now, I am trying to connect to local host, and I'd use UNIX domain socket without password. is that possible? thanks Vicki On 04/08/2016 04:37 PM, Jan-Henrik Haukeland wrote: From the postgres manual: "SSL communication is only possible with TCP/IP connections." On 08 Apr 2016, at 21:40, Vicki Ma <vma@akamai.commailto:vma@akamai.com> wrote: Hi, Thanks for the response. I am trying to connect to a database on localhost via UNIX domain socket. m_connUrlStr = "postgresql://localhost/emp_ame?user=empameuser&unix_socket=/tmp"; it doesn't work, is the connection string above correct? thanks Vicki On 04/07/2016 05:59 PM, Jan-Henrik Haukeland wrote: If you mean authenticate using a client-certificate, then see http://www.postgresql.org/docs/9.1/static/libpq-ssl.html and 31.17.2. Client Certificates. Basically, Postgres (libpq) will handle this automatically if you store your cert in ~/.postgresql/postgresql.crt. Libzdb still requires that you specify a username and password in the connection URL though. Details: Previously, as far as I remember, libpq and PQconnectdb() which libzdb use, did not support auth via client cert so setting client cert as a URL-parameter is not supported. I see from the documentation (http://www.postgresql.org/docs/9.1/static/libpq-connect.html) that this is now possible and we might support this in a later version. On 07 Apr 2016, at 21:52, Vicki Ma <vma@akamai.commailto:vma@akamai.com> wrote: Hi, I plan to use libzdb for connection pooling, but I am not sure if I can connect to the connection pool using user certificate. In the document, it specifies how to connect to Postgresql database. postgresql://localhost:5432/test?user=root&password=swordfish Can I pass the following: postgresql://user:secret@localhost I did not see the options mentioning connecting database using certificates. http://tildeslash.com/libzdb/api-docs/postgresoptions.html Thanks very much, Vicki Ma -- To unsubscribe: http://www.tildeslash.com/mailman/listinfo/libzdb-general -- To unsubscribe: http://www.tildeslash.com/mailman/listinfo/libzdb-general
-- To unsubscribe: http://www.tildeslash.com/mailman/listinfo/libzdb-general