From: Ron Johnson <ron.l.johnson@cox.net>
To: pgsql-general@lists.postgresql.org
Subject: Re: pgpass hostname and IP address
Date: Sat, 10 Mar 2018 00:17:40 -0600
Message-ID: <cb405c65-210f-1a5e-e285-da08e096eb82@cox.net> (raw)
In-Reply-To: <L5BK1x00A1DF5NZ015BMZT>
References: <289728e3-c240-bfb3-2c0b-0016855beb03@cox.net>
<L5BK1x00A1DF5NZ015BMZT>
On 03/09/2018 11:11 PM, Adrian Klaver wrote:
> 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.
That looks promising.
--
Angular momentum makes the world go 'round.
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: ron.l.johnson@cox.net
Subject: Re: pgpass hostname and IP address
In-Reply-To: <cb405c65-210f-1a5e-e285-da08e096eb82@cox.net>
References: <289728e3-c240-bfb3-2c0b-0016855beb03@cox.net> <L5BK1x00A1DF5NZ015BMZT> <cb405c65-210f-1a5e-e285-da08e096eb82@cox.net>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox