From: Adrian Klaver <adrian.klaver@aklaver.com>
To: Ron <ronljohnsonjr@gmail.com>
To: pgsql-general@lists.postgresql.org
Subject: Re: Determine if a user and database are available
Date: Fri, 2 Sep 2022 17:44:35 -0700
Message-ID: <67c3e292-e33a-cad9-bc49-f480b0a31f50@aklaver.com> (raw)
In-Reply-To: <3698b162-8146-cc59-0da4-390d2c6f8189@gmail.com>
References: <CAH8yC8=fbU-DWSNso7qKDSNCj52hTop8ENKxF7_4a=hjY-nn6w@mail.gmail.com>
<1229132.1662157263@sss.pgh.pa.us>
<3698b162-8146-cc59-0da4-390d2c6f8189@gmail.com>
On 9/2/22 17:33, Ron wrote:
> On 9/2/22 17:21, Tom Lane wrote:
>> Jeffrey Walton <noloader@gmail.com> writes:
>>> I have another beginner question. I am trying to use pg_isready to
>>> determine if a database and user are present. The program seems to
>>> always succeed, even when I delete the user or the database.
>> 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?
>
My guess so you can specify a 'test' user that you can track in the logs.
--
Adrian Klaver
adrian.klaver@aklaver.com
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: adrian.klaver@aklaver.com, ronljohnsonjr@gmail.com
Subject: Re: Determine if a user and database are available
In-Reply-To: <67c3e292-e33a-cad9-bc49-f480b0a31f50@aklaver.com>
References: <CAH8yC8=fbU-DWSNso7qKDSNCj52hTop8ENKxF7_4a=hjY-nn6w@mail.gmail.com> <1229132.1662157263@sss.pgh.pa.us> <3698b162-8146-cc59-0da4-390d2c6f8189@gmail.com> <67c3e292-e33a-cad9-bc49-f480b0a31f50@aklaver.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