Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rbRU7-00FQrb-U3 for pgsql-admin@arkaria.postgresql.org; Sat, 17 Feb 2024 20:40:31 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1rbRU6-0088o3-3j for pgsql-admin@arkaria.postgresql.org; Sat, 17 Feb 2024 20:40:30 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rbRU5-0088nv-Kq for pgsql-admin@lists.postgresql.org; Sat, 17 Feb 2024 20:40:29 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rbRTz-007GCz-0D for pgsql-admin@lists.postgresql.org; Sat, 17 Feb 2024 20:40:28 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 41HKeL4k3710277; Sat, 17 Feb 2024 15:40:21 -0500 From: Tom Lane To: Teju Jakkidi vlogs cc: pgsql-admin Subject: Re: pg_hba.conf settings for postgres In-reply-to: References: Comments: In-reply-to Teju Jakkidi vlogs message dated "Sat, 17 Feb 2024 12:33:45 -0800" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3710275.1708202421.1@sss.pgh.pa.us> Date: Sat, 17 Feb 2024 15:40:21 -0500 Message-ID: <3710276.1708202421@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Teju Jakkidi vlogs writes: > Our expectation is that - when logging as postgres user from local host, > it should not prompt for the password as we have local for postgres set to > trust and loopback is set to trust. > However, when running psql as postgres user from the local host, it is > still asking for the password. > Adding below lines in pg_hba.conf file is working as expected: > host all postgres Local IP/32 trust So psql is connecting to the "local IP", not to the loopback address. This is probably a matter of DNS configuration, but since you didn't show us the exact command, it's hard to say more than that. regards, tom lane