From: | Garry Chen <gc92(at)cornell(dot)edu> |
---|---|
To: | Albe Laurenz <laurenz(dot)albe(at)wien(dot)gv(dot)at>, "pgsql-novice(at)postgresql(dot)org" <pgsql-novice(at)postgresql(dot)org> |
Subject: | Re: Re: using LDAP for connection information lookup to do remote database connection |
Date: | 2017-09-20 15:39:34 |
Message-ID: | 2B666F7A-FF25-44E8-B467-68A21CA7C293@cornell.edu |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-novice |
Hi Alb,
Is there a way to give a username and passwd at the connection time? Another word, not to set the username in gp_server.conf file. Because psql just used my OS login id as username When I remove the username from pg_server.conf file.
Garry
On 9/19/17, 11:35 AM, "pgsql-novice-owner(at)postgresql(dot)org on behalf of Garry Chen" <pgsql-novice-owner(at)postgresql(dot)org on behalf of gc92(at)cornell(dot)edu> wrote:
HI Albe,
Thank you very much, It is working now after few modifications on pg_service file.
Garry
On 9/19/17, 11:04 AM, "Albe Laurenz" <laurenz(dot)albe(at)wien(dot)gv(dot)at> wrote:
Garry Chen wrote:
> Is it passable to use LDAP for connection string lookup when try to
> connect to remote database using psql? I have client install on my work station and my
> LDAP entry for remote postgresql database looks like this:
>
> cn=pgrls,cn=OracleContext
> cn=pgrls
> objectclass=orclDBServer
> objectclass=top
> objectclass=orclService
> description=host=pgrls.cy53k5nd.us-east-1.rds.amazonaws.com
> description=port=5439
> description=dbname=pgrls
>
> And my .pg_service.conf
> ldap://oid.ldap.cornell.edu:389:636/cn=OracleContext?description?one?(cn=pgrls)
You know that there has to be more than one line in the file?
There is a complete example of a stanza at the bottom of
https://www.postgresql.org/docs/current/static/libpq-ldap.html
In particular, the stanza has to begin with a line in brackets, like
[mydatabase]
Other than that, the LDAP URL looks fine.
> When
> > psql pgrls
> psql: could not connect to server: No such file or directory
> Is the server running locally and accepting
> connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?
>
> Can anyone guide me through how to?
You'd have to call it like this:
psql "service=mydatabase"
(Assuming that you named the service control file stanza "mydatabase".)
Yours,
Laurenz Albe
--
Sent via pgsql-novice mailing list (pgsql-novice(at)postgresql(dot)org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-novice
From | Date | Subject | |
---|---|---|---|
Next Message | Alvaro Herrera | 2017-09-20 15:43:42 | Re: Re: using LDAP for connection information lookup to do remote database connection |
Previous Message | Garry Chen | 2017-09-19 15:34:51 | Re: using LDAP for connection information lookup to do remote database connection |