Re: BUG #15168: "pg_isready -d" effectively ignores given database name

From: jake <jakelist(at)zoho(dot)com>
To: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
Cc: "pgsql-bugs(at)lists(dot)postgresql(dot)org" <pgsql-bugs(at)lists(dot)postgresql(dot)org>
Subject: Re: BUG #15168: "pg_isready -d" effectively ignores given database name
Date: 2018-04-25 04:30:30
Message-ID: 162fb1131d6.12ac3be2b9673.5239359614834465495@zoho.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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 &lt;db-name&gt;

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

Jake T.

In response to

Responses

Browse pgsql-bugs by date

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