pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: jake <jakelist@zoho.com>
To: David G. Johnston <david.g.johnston@gmail.com>
Cc: pgsql-bugs@lists.postgresql.org <pgsql-bugs@lists.postgresql.org>
Subject: Re: BUG #15168: "pg_isready -d" effectively ignores given database name
Date: Tue, 24 Apr 2018 21:30:30 -0700
Message-ID: <162fb1131d6.12ac3be2b9673.5239359614834465495@zoho.com> (raw)
In-Reply-To: <162facd1147.ba69cee29221.2693379920764956968@zoho.com>
References: <152454331410.19803.86605614092680300@wrigleys.postgresql.org>
	<CAKFQuwZb+XrzPJ48ZbO52Yd=oAxFrRhSTK_XXr3Z4kLoL5d8Yw@mail.gmail.com>
	<162f93f6c75.cdd696776295.5991878161692757736@zoho.com>
	<162fa45b1f0.e784e91e8344.4158165001514423492@zoho.com>
	<CAKFQuwZ-onpo9B04Ziz6FEmq3iKttieGDni4Sp4YY7siigCt=g@mail.gmail.com>
	<162facd1147.ba69cee29221.2693379920764956968@zoho.com>

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.

view thread (8+ messages)  latest in thread

Message-ID: <162fb1131d6.12ac3be2b9673.5239359614834465495@zoho.com>
Permalink:  ../162fb1131d6.12ac3be2b9673.5239359614834465495@zoho.com/
Also on:    postgresql.org/message-id/162fb1131d6.12ac3be2b9673.5239359614834465495@zoho.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: jakelist@zoho.com, david.g.johnston@gmail.com
  Subject: Re: BUG #15168: "pg_isready -d" effectively ignores given database name
  In-Reply-To: <162fb1131d6.12ac3be2b9673.5239359614834465495@zoho.com>
  References: <152454331410.19803.86605614092680300@wrigleys.postgresql.org> <CAKFQuwZb+XrzPJ48ZbO52Yd=oAxFrRhSTK_XXr3Z4kLoL5d8Yw@mail.gmail.com> <162f93f6c75.cdd696776295.5991878161692757736@zoho.com> <162fa45b1f0.e784e91e8344.4158165001514423492@zoho.com> <CAKFQuwZ-onpo9B04Ziz6FEmq3iKttieGDni4Sp4YY7siigCt=g@mail.gmail.com> <162facd1147.ba69cee29221.2693379920764956968@zoho.com> <162fb1131d6.12ac3be2b9673.5239359614834465495@zoho.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox