Re: TCP keepalive support for libpq - Mailing list pgsql-hackers

From Robert Haas
Subject Re: TCP keepalive support for libpq
Date
Msg-id AANLkTin3N-oUUSE5QNzYpAvmzeJCynMteoWExBZZCjU9@mail.gmail.com
Whole thread Raw
In response to Re: TCP keepalive support for libpq  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Wed, Jun 23, 2010 at 4:56 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Fujii Masao <masao.fujii@gmail.com> writes:
>> On Wed, Jun 23, 2010 at 5:32 AM, Robert Haas <robertmhaas@gmail.com> wrote:
>>> OK, here's a new version with several fewer bugs.
>
>> Since valid values for keepalives parameter are 0 and 1, its field size should
>> be 1 rather than 10.
>
> Right ... although maybe it should be considered a boolean and not an
> int at all?

Well, really, all libpq parameters are just strings, at this level.
The dispsize is just a hint for, I guess, things like PGadmin; it's
not actually used by libpq.

>> In this case, you can check the value of keepalives parameter by seeing
>> conn->keepalives[0] instead of using strtol() in useKeepalives().
>
> I disagree with that idea, though.  The field size has nothing to do
> with most of the possible sources of the variable's value ...

That is my thought also.

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


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: TCP keepalive support for libpq
Next
From: Guillaume Lelarge
Date:
Subject: Re: Cannot cancel the change of a tablespace