Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1euXpQ-0004nf-KP for pgsql-general@arkaria.postgresql.org; Sat, 10 Mar 2018 06:18:00 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1euXpO-0002LZ-Du for pgsql-general@arkaria.postgresql.org; Sat, 10 Mar 2018 06:17:58 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1euXpO-0002LQ-69 for pgsql-general@lists.postgresql.org; Sat, 10 Mar 2018 06:17:58 +0000 Received: from eastrmfepo102.cox.net ([68.230.241.214]) by magus.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1euXpC-0003u6-Cd for pgsql-general@lists.postgresql.org; Sat, 10 Mar 2018 06:17:56 +0000 Received: from eastrmimpo110.cox.net ([68.230.241.223]) by eastrmfepo102.cox.net (InterMail vM.8.01.05.28 201-2260-151-171-20160122) with ESMTP id <20180310061741.SZVQ24661.eastrmfepo102.cox.net@eastrmimpo110.cox.net> for ; Sat, 10 Mar 2018 01:17:41 -0500 Received: from [192.168.1.10] ([70.171.109.83]) by eastrmimpo110.cox.net with cox id L6Hg1x00A1o04Vy016Hgfv; Sat, 10 Mar 2018 01:17:40 -0500 X-Authority-Analysis: v=2.2 cv=KdaiiUQD c=1 sm=1 tr=0 a=uCHdjGDeLqaieW9t8IbZ6A==:117 a=uCHdjGDeLqaieW9t8IbZ6A==:17 a=IkcTkHD0fZMA:10 a=x7bEGLp0ZPQA:10 a=T11QR6bd6vIA:10 a=epTmVMiNAAAA:8 a=Fs_XoLYPI9aUYCm1EfgA:9 a=sjEDqDTrEBIMTd57:21 a=qEWDWoXTQjvj-Gp7:21 a=QEXdDO2ut3YA:10 a=QrLhGQdYBCwA:10 a=tWZSQKeJShkA:10 a=iJuSKtK9A8QA:10 a=HyGofqEtR4YA:10 a=ndEWmUVY6Yapc0oHF_P4:22 X-CM-Score: 0.00 Authentication-Results: cox.net; auth=pass (PLAIN) smtp.auth=ron.l.johnson@cox.net Subject: Re: pgpass hostname and IP address To: pgsql-general@lists.postgresql.org References: <289728e3-c240-bfb3-2c0b-0016855beb03@cox.net> From: Ron Johnson Message-ID: Date: Sat, 10 Mar 2018 00:17:40 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk 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.