From: Christophe Pettus <xof@thebuild.com>
To: noloader@gmail.com
Cc: pgsql-general@lists.postgresql.org
Subject: Re: Determine if a user and database are available
Date: Fri, 2 Sep 2022 14:42:34 -0700
Message-ID: <FB14ACCE-7F7D-4AE7-837A-1E1568FD55A4@thebuild.com> (raw)
In-Reply-To: <CAH8yC8=fbU-DWSNso7qKDSNCj52hTop8ENKxF7_4a=hjY-nn6w@mail.gmail.com>
References: <CAH8yC8=fbU-DWSNso7qKDSNCj52hTop8ENKxF7_4a=hjY-nn6w@mail.gmail.com>
> On Sep 2, 2022, at 14:22, Jeffrey Walton <noloader@gmail.com> 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 <connection info) -c "SELECT 1"
... will return an error if the connection information can't be used to successfully log in.
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: xof@thebuild.com, noloader@gmail.com
Subject: Re: Determine if a user and database are available
In-Reply-To: <FB14ACCE-7F7D-4AE7-837A-1E1568FD55A4@thebuild.com>
References: <CAH8yC8=fbU-DWSNso7qKDSNCj52hTop8ENKxF7_4a=hjY-nn6w@mail.gmail.com> <FB14ACCE-7F7D-4AE7-837A-1E1568FD55A4@thebuild.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox