Re: [WIP] pg_ping utility - Mailing list pgsql-hackers

From Robert Haas
Subject Re: [WIP] pg_ping utility
Date
Msg-id CA+TgmoahW52kxBwCREQSMTUkXT3+kTToY6EQcARiqErjtYavJw@mail.gmail.com
Whole thread Raw
In response to Re: [WIP] pg_ping utility  (Phil Sorber <phil@omniti.com>)
Responses Re: [WIP] pg_ping utility
List pgsql-hackers
On Sun, Jan 20, 2013 at 2:59 PM, Phil Sorber <phil@omniti.com> wrote:
> Ok. I can add something to the notes section of the docs. I can also
> add some code comments for this and for grabbing the default params.

Sounds good.

>> Oh, I see.  Is it really important to have the host and port in the
>> output, or should we trim that down to just e.g. "accepting
>> connections"?  It seems useful to have that if a human is looking at
>> the output, but maybe not if a machine is looking at the output.  And
>> if somebody doesn't want it, getting rid of it with sed or awk is
>> nontrivial - imagine:
>>
>> pg_isready -d "/tmp:5432 - accepting connections"
>
> If you are scripting I'd assume you would use the return code value.
> It might be reasonable to make adding the host and port the verbose
> method and have just "accepting connections" as the default output,
> but my concern there is a misdiagnosis because someone doesn't realize
> what server they are connecting to. This way they can't miss it and
> they don't have to add another command line option to get that output.

It's a fair concern.  Does anyone else have an opinion on this?

> The other thing I thought about when you mentioned this is not doing
> the default lookups if it's in quiet mode. I could move things around
> to accomplish this, but not sure it is worth the effort and
> complexity. Thoughts?

That doesn't seem to buy us anything.  I'm fine with the code, now
that I see what it's intended to do.  It doesn't cost anything
noticeable in terms of efficiency; I think, I just didn't want to make
things complicated without a reason.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company



pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: proposal: fix corner use case of variadic fuctions usage
Next
From: Craig Ringer
Date:
Subject: Re: dividing privileges for replication role.