Anony Mous wrote:
> Thanks, Richard.
>
> I've never seen this behaviour before in 7.4.3 and indeed it is the only
> connection to the back end at the time when the count is occurring. However,
> it would have had the connection for at least 30 seconds before requesting a
> count.
>
> Is there a better method of obtaining the number of connections to the
> backend?
Other than "ps" - no I don't think so. The 30 seconds doesn't sound
right, Tom reckoned 0.5sec which sounds plausible. Might this be the
first query you've sent on this connection?
I'm wondering if the ODBC connection isn't actually established until
you run the first query? It doesn't sound right to me, but I don't have
any of my ODBC apps to hand at the moment to check.
Could you:
1. Connect
2. SELECT 1; (or similar)
3. Sleep from 10msec => 1sec
4. SELECT * FROM pg_stat_activity;
That way we could disable step 2 and tinker with the delay in step 3 to
see what happens.
--
Richard Huxton
Archonet Ltd