Re: [WIP] pg_ping utility

From: Phil Sorber <phil(at)omniti(dot)com>
To: Christopher Browne <cbbrowne(at)gmail(dot)com>
Cc: Peter Eisentraut <peter_e(at)gmx(dot)net>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: [WIP] pg_ping utility
Date: 2012-10-24 00:19:56
Message-ID: CADAkt-jDMjvvHsnn_17ckyC529hRiqMNcCyfBn=9X97vXz_-0w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Oct 23, 2012 at 6:22 PM, Christopher Browne <cbbrowne(at)gmail(dot)com> wrote:
> On Tue, Oct 23, 2012 at 6:12 PM, Peter Eisentraut <peter_e(at)gmx(dot)net> wrote:
>> On 10/22/12 11:47 AM, Phil Sorber wrote:
>> Also, it seems that about 75% of the patch is connection options processing. How about
>> we get rid of all that and just have them specify a connection string? It would be a break
>> with tradition, but maybe it's time for something new.
>
> I'd be pretty pleased if it had just two ways to get configured:
> a) A connection string (which might, in the new order of things, be a
> JDBC-like URI), or
> b) Environment values drawn in from PGHOST/PGPORT/...

When I first wrote this for my own purposes it was basically 'return
PQping("");' with the necessary glue around it and I used the env
var's exactly as you describe. I ended up adding connection parameters
to satisfy the ops guy who was having trouble integrating it how we
wanted to use it. I figured that to go in core it would need that
anyway. I'm not sure why we would want to prevent people from using
command line options like that. That is often the most intuitive way
to use a tool. Either way I think this is probably a separate debate
entirely.

>
> That's pretty much enough configurability, I'd think.
>
>> Functionality:
>>
>> I'm missing the typical ping functionality to ping continuously. If we're going to call
>> it pg_ping, it ought to do something similar to ping, I think.
>
> Yep, should have equivalents to:
> -i, an interval between pings,
> -c, a count
> -w/-W, a timeout interval

Like I replied to Peter above, I'm not sure it fits the mold of the
ping network utility. If you think it needs a different name please
propose one. I'm not totally closed off to this idea, it's just not
what I had in mind when I put it together. If people find it useful, I
can add it.

>
> Might be nice to have analogues to:
> -D printing timestamp before each line
> -q quiets output
> -v verbose output (got it, check!)
> -V version (got it, check!)

Right now it outputs nothing by default. I suppose I could change it
to output "Accepting/Rejecting Connections" by default, and verbose
can add the connection info. Thoughts?

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Noah Misch 2012-10-24 00:21:54 Re: [WIP] Performance Improvement by reducing WAL for Update Operation
Previous Message Phil Sorber 2012-10-24 00:10:35 Re: [WIP] pg_ping utility