Re: Determine if a user and database are available

2022-09-06 Thread Jeffrey Walton
On Fri, Sep 2, 2022 at 5:43 PM Christophe Pettus wrote: > > > On Sep 2, 2022, at 14:22, Jeffrey Walton 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

Re: Determine if a user and database are available

2022-09-02 Thread Tom Lane
Ron 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 expl

Re: Determine if a user and database are available

2022-09-02 Thread Adrian Klaver
On 9/2/22 17:33, Ron wrote: On 9/2/22 17:21, Tom Lane wrote: Jeffrey Walton 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 featu

Re: Determine if a user and database are available

2022-09-02 Thread Ron
On 9/2/22 17:21, Tom Lane wrote: Jeffrey Walton 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 us

Re: Determine if a user and database are available

2022-09-02 Thread Tom Lane
Jeffrey Walton 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

Re: Determine if a user and database are available

2022-09-02 Thread David G. Johnston
On Friday, September 2, 2022, Jeffrey Walton 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 fai

Re: Determine if a user and database are available

2022-09-02 Thread Christophe Pettus
> On Sep 2, 2022, at 14:22, Jeffrey Walton 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 pat

Determine if a user and database are available

2022-09-02 Thread Jeffrey Walton
Hi Everyone, 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. This baffles me from the man page. I guess this explains the behavior I am seeing. N