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 1oUERz-0004HD-3R for pgsql-general@arkaria.postgresql.org; Fri, 02 Sep 2022 21:43:43 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oUERw-0001sp-UX for pgsql-general@arkaria.postgresql.org; Fri, 02 Sep 2022 21:43:40 +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 1oUERw-0001sf-Jh for pgsql-general@lists.postgresql.org; Fri, 02 Sep 2022 21:43:40 +0000 Received: from smtp67.iad3a.emailsrvr.com ([173.203.187.67]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oUERu-0007GB-1c for pgsql-general@lists.postgresql.org; Fri, 02 Sep 2022 21:43:40 +0000 X-Auth-ID: xof@thebuild.com Received: by smtp25.relay.iad3a.emailsrvr.com (Authenticated sender: xof-AT-thebuild.com) with ESMTPSA id F1404230BF; Fri, 2 Sep 2022 17:43:35 -0400 (EDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.7\)) Subject: Re: Determine if a user and database are available From: Christophe Pettus In-Reply-To: Date: Fri, 2 Sep 2022 14:42:34 -0700 Cc: pgsql-general@lists.postgresql.org X-Mailbutler-Message-Id: E66D924F-968F-4AFF-A246-7F9DF702AA80 Content-Transfer-Encoding: quoted-printable Message-Id: References: To: noloader@gmail.com X-Mailer: Apple Mail (2.3608.120.23.2.7) X-Classification-ID: 79bf79fd-ffa9-44f0-8d63-bdfce75636d7-1-1 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk > On Sep 2, 2022, at 14:22, Jeffrey Walton wrote: > Given the NOTES in the man page, how do we determine if a user and > database are present using the shell? Is there another utility we > should be using? pg_isready literally only checks that the server can be reached over the = connection path (network or sockets), not that any login credentials = work. You can use psql do that, though: psql