Re: pgpass hostname and IP address - Mailing list pgsql-general

From Adrian Klaver
Subject Re: pgpass hostname and IP address
Date
Msg-id 63ad2044-1e97-7780-050e-95de1ffdb4d7@aklaver.com
Whole thread Raw
In response to pgpass hostname and IP address  (Ron Johnson <ron.l.johnson@cox.net>)
List pgsql-general
On 03/09/2018 08:19 PM, Ron Johnson wrote:
> (8.4 and 9.2, but soon to 9.6)
> 
> If we sometimes access a db server by IP address, and sometimes by 
> hostname, must we have two entries for each server+user (one with the 
> hostname and the other with IP address), or is there a way to put them 
> both on the same line?
> 

Not with .pgpass, though there is the service file method:

https://www.postgresql.org/docs/9.6/static/libpq-pgservice.html

https://www.postgresql.org/docs/10/static/libpq-connect.html#LIBPQ-CONNSTRING

service

     Service name to use for additional parameters. It specifies a 
service name in pg_service.conf that holds additional connection 
parameters. This allows applications to specify only a service name so 
connection parameters can be centrally maintained. See Section 33.16.



-- 
Adrian Klaver
adrian.klaver@aklaver.com


pgsql-general by date:

Previous
From: Ron Johnson
Date:
Subject: Re: pgpass hostname and IP address
Next
From: Ron Johnson
Date:
Subject: Re: pgpass hostname and IP address