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 1euWmv-0001Jd-Jd for pgsql-general@arkaria.postgresql.org; Sat, 10 Mar 2018 05:11:21 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1euWmr-0001li-Vd for pgsql-general@arkaria.postgresql.org; Sat, 10 Mar 2018 05:11:17 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1euWmr-0001lZ-2K for pgsql-general@lists.postgresql.org; Sat, 10 Mar 2018 05:11:17 +0000 Received: from out2-smtp.messagingengine.com ([66.111.4.26]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1euWmj-0007Sq-Ek for pgsql-general@lists.postgresql.org; Sat, 10 Mar 2018 05:11:15 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 0528920EC5; Sat, 10 Mar 2018 00:11:08 -0500 (EST) Received: from frontend1 ([10.202.2.160]) by compute6.internal (MEProxy); Sat, 10 Mar 2018 00:11:08 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc; s=fm2; bh=f7fJSyFsepYDPCdffledx55sUG/1u 6tMcwxYQZ0Lmhc=; b=Y9+M0GUx76yut8zXYfGJ3vPvSd0faUeSyXbA+Uq3lMIV4 6+zvJaLH9vTXOGHao6G6l7KA4e0asMajXWt1ZQKHoXKgezkNalj6GNCJYR6cVbmw wyvHHqP07XmeDcLNhBQ629JV9avIWsGfGMDXZWm5IQoLw1rIMI16IeZcqFQZQ2oH 22j9xE0nj+NSFsKPSis63OLWR/c5GgrQpcmTlNgrufx7H36BNvqmNt6NCAl9ou3I 7bu6DddmFFM4jRgCtLp83Kcor2cX3WIIZfo9Dkvos5LAD8byA6k9v8I9IHAHBcl0 yCrBaOoLMckENaJ2uIrKgeZzw6gOYTaAIgpi9O7Pg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=f7fJSy FsepYDPCdffledx55sUG/1u6tMcwxYQZ0Lmhc=; b=eDTBxDbzBqM24mtfpNzHZ7 guZQJFm7/HE1Oldq/GWeTaI+GRnhCcKUjSB553NP/xspmKIPtO/3uBJeVjSpOHqK ZmhOw5KLe0nIOQ1j5p+ZJR4axvcCA31BZ/ppAfC0FodOMI06pYSClkCWQ0Cze/X8 Jrhk7+QZb8tx8gw6WppVEi390rwoiZ3FoDtEgS4wydsI7/vJb8ByC1hPJnHdwDLe QtZyGWPxgvCNsDnKIApdNZ+980iZHPk3Mc3HRxwxt4BC7+Cyp7KZ6kgGQlFQ7cSH J6ziwOTyb4artw0Bt6rsnKE08fSe2XHXmXgs2MdGFoow+MXcMuGXFi881n0GL1aA == X-ME-Sender: Received: from [192.168.1.2] (71-35-123-124.tukw.qwest.net [71.35.123.124]) by mail.messagingengine.com (Postfix) with ESMTPA id 6E71A7E0A5; Sat, 10 Mar 2018 00:11:07 -0500 (EST) Subject: Re: pgpass hostname and IP address To: Ron Johnson , pgsql-general@lists.postgresql.org References: <289728e3-c240-bfb3-2c0b-0016855beb03@cox.net> From: Adrian Klaver Message-ID: <63ad2044-1e97-7780-050e-95de1ffdb4d7@aklaver.com> Date: Fri, 9 Mar 2018 21:11:06 -0800 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: <289728e3-c240-bfb3-2c0b-0016855beb03@cox.net> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk 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