Re: Determine if a user and database are available

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Ron <ronljohnsonjr(at)gmail(dot)com>
Cc: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: Determine if a user and database are available
Date: 2022-09-03 00:55:24
Message-ID: 1255447.1662166524@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Ron <ronljohnsonjr(at)gmail(dot)com> 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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message BeginnerC 2022-09-03 08:37:50 [Beginner Querstion]Where can I find the news of database?
Previous Message Adrian Klaver 2022-09-03 00:44:35 Re: Determine if a user and database are available