Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oUHRc-0001j7-67 for pgsql-general@arkaria.postgresql.org; Sat, 03 Sep 2022 00:55:32 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oUHRa-0006mR-Hd for pgsql-general@arkaria.postgresql.org; Sat, 03 Sep 2022 00:55:30 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oUHRa-0006mI-7H for pgsql-general@lists.postgresql.org; Sat, 03 Sep 2022 00:55:30 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oUHRX-0000OX-Ta for pgsql-general@lists.postgresql.org; Sat, 03 Sep 2022 00:55:29 +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 2830tOFM1255448; Fri, 2 Sep 2022 20:55:24 -0400 From: Tom Lane To: Ron cc: pgsql-general@lists.postgresql.org Subject: Re: Determine if a user and database are available In-reply-to: <3698b162-8146-cc59-0da4-390d2c6f8189@gmail.com> References: <1229132.1662157263@sss.pgh.pa.us> <3698b162-8146-cc59-0da4-390d2c6f8189@gmail.com> Comments: In-reply-to Ron message dated "Fri, 02 Sep 2022 19:33:26 -0500" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1255446.1662166524.1@sss.pgh.pa.us> Date: Fri, 02 Sep 2022 20:55:24 -0400 Message-ID: <1255447.1662166524@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Ron writes: > On 9/2/22 17:21, Tom Lane wrote: >> That's a feature actually. The intended use of pg_isready is to >> find out if the server is alive, not whether any particular user >> or database name is correct. > Then what's the point of the --username=USERNAME connection option? That's explained in the documentation extract already quoted: if you do use a bad user/db/password, the server will log a message about that, since it just sees a failed connection attempt. If you'd rather not have such chatter in your log, then you want to give pg_isready valid connection data. But that's incidental to the purpose of the program. regards, tom lane