Re: [WIP] pg_ping utility

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Phil Sorber <phil(at)omniti(dot)com>
Cc: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>, Erik Rijkers <er(at)xs4all(dot)nl>, Bruce Momjian <bruce(at)momjian(dot)us>, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, Dimitri Fontaine <dimitri(at)2ndquadrant(dot)fr>, Peter Eisentraut <peter_e(at)gmx(dot)net>, PostgreSQL-development Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [WIP] pg_ping utility
Date: 2013-01-21 03:26:59
Message-ID: CA+TgmoahW52kxBwCREQSMTUkXT3+kTToY6EQcARiqErjtYavJw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sun, Jan 20, 2013 at 2:59 PM, Phil Sorber <phil(at)omniti(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Craig Ringer 2013-01-21 03:30:08 Re: dividing privileges for replication role.
Previous Message Robert Haas 2013-01-21 03:23:19 Re: proposal: fix corner use case of variadic fuctions usage