Re: Determine if a user and database are available - Mailing list pgsql-general

From David G. Johnston
Subject Re: Determine if a user and database are available
Date
Msg-id CAKFQuwYLrrnXqQNvVow58HKwjmoapLyNfzo+099zwAYQHQ28mQ@mail.gmail.com
Whole thread Raw
In response to Determine if a user and database are available  (Jeffrey Walton <noloader@gmail.com>)
List pgsql-general
On Friday, September 2, 2022, 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?

Literally every other shell program that requires logging into the database will fail if invalid credentials are provided.

Or, you can use good credentials and psql to connect to a known database and then query the system to learn, without an error, if other roles or databases exist in the same cluster.

David J.

pgsql-general by date:

Previous
From: Christophe Pettus
Date:
Subject: Re: Determine if a user and database are available
Next
From: Tom Lane
Date:
Subject: Re: Determine if a user and database are available