I'm looking at adding win32 support for keepalives in libpq (well,
also backend, but libpq for now), per the request from Robert Haas.
I've come up with one issue though - in Windows, you can only set the
"idle" and "interval" parameter together in a single syscall (in Unix,
you have one for each). There is no support for setting the counter at
However, there is no API for *reading* the current value, nor the
default value. There is no way to specify "set the default". If we set
one of them to zero, it really means zero - no interval at all (so
it'll flood out the packets - really fun when you enable it for
The default value for these are available in the registry only.
The way I see it, we have two options:
1) Read the default value from the registry. That's some fairly ugly code, imho.
2) Ignore the registry value and use the default value of 2 hours/1
second. That will override any changes the user made in the registry,
which seems pretty ugly.
3) Require that these two parameters are always specified together (on
windows). Which is annoying.
Not sure which one to pick - opinions?
The API used is documented at:
Patch as it looks now (libpq only, and with obvious problems with this
pgsql-hackers by date
|Next:||From: Tom Lane||Date: 2010-06-28 18:26:19|
|Subject: Re: Keepalive for max_standby_delay |
|Previous:||From: Kevin Grittner||Date: 2010-06-28 18:06:45|
|Subject: Re: Admission Control|