Re: libpq WSACleanup is not needed - Mailing list pgsql-hackers

From James Mansion
Subject Re: libpq WSACleanup is not needed
Date
Msg-id 4973C226.7080102@mansionfamily.plus.com
Whole thread Raw
In response to Re: libpq WSACleanup is not needed  (Magnus Hagander <magnus@hagander.net>)
Responses Re: libpq WSACleanup is not needed  (Andrew Chernow <ac@esilo.com>)
Re: libpq WSACleanup is not needed  (Bruce Momjian <bruce@momjian.us>)
List pgsql-hackers
Magnus Hagander wrote:
> The use-case of rapidly creating and dropping connections isn't
> particularly common, I think. And there is a perfectly functioning
> workaround - something that we should perhaps document in the FAQ or
> somewhere in the documentation?
>   
Would it be accetable to do initialise if the number of connections is 
changing from 0, and
tidy if the cumber goes back to 0?  Applications that retain a 
connection would not
suffer the cost on subsequent connect/disconnect.

The init/term is the tidiest way to do it, but the above might help - 
perhaps init could just
add a phantom usecount and work the same way.

If you have a DLL for libpq, could you do it in process attach and 
detach?  Wouldn't
that be the most common case anyway?

James



pgsql-hackers by date:

Previous
From: "Brendan Jurd"
Date:
Subject: Re: pg_dump versus views and opclasses
Next
From: Andrew Chernow
Date:
Subject: Re: libpq WSACleanup is not needed