Re: Determine if a user and database are available

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Determine if a user and database are available
Дата
Msg-id 1229132.1662157263@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Determine if a user and database are available  (Jeffrey Walton <noloader@gmail.com>)
Ответы Re: Determine if a user and database are available  (Ron <ronljohnsonjr@gmail.com>)
Список pgsql-general
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.  So it treats responses like "no such
database" as sufficient proof that the server is alive.

As David says, you could try to log in with any other client
software, or connect using known-good parameters and check
the system catalogs.

            regards, tom lane



В списке pgsql-general по дате отправления:

Предыдущее
От: "David G. Johnston"
Дата:
Сообщение: Re: Determine if a user and database are available
Следующее
От: Ron
Дата:
Сообщение: Re: Determine if a user and database are available