Re: BUG #15168: "pg_isready -d" effectively ignores given databasename - Mailing list pgsql-bugs

From jake
Subject Re: BUG #15168: "pg_isready -d" effectively ignores given databasename
Date
Msg-id 162fb1131d6.12ac3be2b9673.5239359614834465495@zoho.com
Whole thread Raw
In response to BUG #15168: "pg_isready -d" effectively ignores given database name  (PG Bug reporting form <noreply@postgresql.org>)
Responses Re: BUG #15168: "pg_isready -d" effectively ignores given database name  ("David G. Johnston" <david.g.johnston@gmail.com>)
List pgsql-bugs
Well, after fleshing out your command, I got:

psql -tc "select 1 from pg_catalog.pg_database where datname='snowdrift';" | grep -qw 1

That looks more complicated than the StackOverflow solution:

psql -lt | cut -f1 -d \| | grep -qw <db-name>

Or at least it's longer. Hmm. I guess personal taste is a big factor here.

Jake T.


pgsql-bugs by date:

Previous
From: Rick Gabriel
Date:
Subject: Re: BUG #15170: PQtransactionStatus returns ACTIVE after Empty Commit
Next
From: "David G. Johnston"
Date:
Subject: Re: BUG #15168: "pg_isready -d" effectively ignores given database name