Search Postgresql Archives

Re: DB alias ?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Dave Gauthier wrote:
> I would have suggested to use pg_services file as documented at
> 
> http://www.postgresql.org/docs/9.1/static/libpq-pgservice.html
> http://www.postgresql.org/docs/9.1/static/libpq-connect.html
> 
> You can think of this as tnsnames replacement.
> 
> but I am unable to make it work. I don't know what is wrong with this.
> 
> shridhar@bheem ~$ cat ~/.pg_service.conf
> [test1]
> host=localhost
> dbname=test
> 
> shridhar@bheem ~$ strace -o psql.strace psql test1

That's wrong.  It should have been
  psql "service=test1"
as has been pointed out.

> psql: FATAL: database "test1" does not exist
> 
> shridhar@bheem ~$ grep -i pg_service psql.strace
> 
> shridhar@bheem ~$ psql test
> psql (9.2.2)
> Type "help" for help.
>
> test=# \q
> 
> shridhar@bheem ~$ psql --version
> psql (PostgreSQL) 9.2.2

> The services file looked/looks interesting, but there are far too many clients, and at multiple sites,
> to manage this.  I really need something on the server side, a single place to manage this for all
> connections regardless of where they are coming from.  It also looks like a C lib based file,
> something I won't have access to except, maybe, through an app designed for DBAs to edit this file.
> If I am mistaken, and the services file is in the DB root area (the area specified after the "-D" in
> commands like pg_ctl), then maybe this is still viable.  But I don't see a services file there :-(

The service file is on the client side.

In a scenario like yours, use LDAP lookup:
http://www.postgresql.org/docs/current/static/libpq-ldap.html

Yours,
Laurenz Albe


-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux