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

From David G. Johnston
Subject Re: BUG #15168: "pg_isready -d" effectively ignores given database name
Date
Msg-id CAKFQuwZ-onpo9B04Ziz6FEmq3iKttieGDni4Sp4YY7siigCt=g@mail.gmail.com
Whole thread Raw
In response to BUG #15168: "pg_isready -d" effectively ignores given database name  (PG Bug reporting form <noreply@postgresql.org>)
List pgsql-bugs
On Tue, Apr 24, 2018 at 5:48 PM, jake <jakelist@zoho.com> wrote:
After discussing this with the Lead Developer of Snowdrift.coop, I'd like to humbly suggest that the specification be slightly adjusted to remove the surprising aspect.

​I'd argue that you would spell that:

psql -c 'SELECT 1;'

or (with maybe a more useful select-list, like version, to reinforce you are where you think you are), with whatever options and environment you wish tacked onto it.

Turning something that today that conforms to the spec and results in success into a failure is generally undesirable.

I'd be more inclined to modify pg_isready to simply ignore any user/password/database arguments in the environment, and remove them from the command line spec (or document them as being ignored since they are accepted today), if that is possible.  Then the API and its charter would match AND you'd avoid the spurious FATAL in the log.

For the spec you describe a new utility command would likely be a better solution.

David J.

pgsql-bugs by date:

Previous
From: jake
Date:
Subject: Re: BUG #15168: "pg_isready -d" effectively ignores given databasename
Next
From: Rick Gabriel
Date:
Subject: Re: BUG #15170: PQtransactionStatus returns ACTIVE after Empty Commit