pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Adrian Klaver <adrian.klaver@aklaver.com>
To: Ron Johnson <ron.l.johnson@cox.net>
To: pgsql-general@lists.postgresql.org
Subject: Re: pgpass hostname and IP address
Date: Fri, 9 Mar 2018 21:11:06 -0800
Message-ID: <63ad2044-1e97-7780-050e-95de1ffdb4d7@aklaver.com> (raw)
In-Reply-To: <289728e3-c240-bfb3-2c0b-0016855beb03@cox.net>
References: <289728e3-c240-bfb3-2c0b-0016855beb03@cox.net>

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




view thread (5+ messages)  latest in thread

Message-ID: <63ad2044-1e97-7780-050e-95de1ffdb4d7@aklaver.com>
Permalink:  ../63ad2044-1e97-7780-050e-95de1ffdb4d7@aklaver.com/
Also on:    postgresql.org/message-id/63ad2044-1e97-7780-050e-95de1ffdb4d7@aklaver.com

 · 

reply

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: adrian.klaver@aklaver.com, ron.l.johnson@cox.net
  Subject: Re: pgpass hostname and IP address
  In-Reply-To: <63ad2044-1e97-7780-050e-95de1ffdb4d7@aklaver.com>
  References: <289728e3-c240-bfb3-2c0b-0016855beb03@cox.net> <63ad2044-1e97-7780-050e-95de1ffdb4d7@aklaver.com>

* 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