|
1 |
| -<!-- $PostgreSQL: pgsql/doc/src/sgml/libpq.sgml,v 1.275 2009/01/10 20:14:30 momjian Exp $ --> |
| 1 | +<!-- $PostgreSQL: pgsql/doc/src/sgml/libpq.sgml,v 1.276 2009/02/06 18:18:54 momjian Exp $ --> |
2 | 2 |
|
3 | 3 | <chapter id="libpq">
|
4 | 4 | <title><application>libpq</application> - C Library</title>
|
|
63 | 63 | The <function>PQstatus</> function should be called to check
|
64 | 64 | whether a connection was successfully made before queries are sent
|
65 | 65 | via the connection object.
|
| 66 | + |
| 67 | + <note> |
| 68 | + <para> |
| 69 | + On Windows, there is a way to improve performance if a single |
| 70 | + database connection is repeated started and shutdown. Internally, |
| 71 | + libpq calls WSAStartup() and WSACleanup() for connection startup |
| 72 | + and shutdown, respectively. WSAStartup() increments an internal |
| 73 | + Windows library reference count which is decremented by WSACleanup(). |
| 74 | + When the reference count is just one, calling WSACleanup() frees |
| 75 | + all resources and all DLLs are unloaded. This is an expensive |
| 76 | + operation. To avoid this, an application can manually call |
| 77 | + WSAStartup() so resources will not be freed when the last database |
| 78 | + connection is closed. |
| 79 | + </para> |
| 80 | + </note> |
66 | 81 |
|
67 | 82 | <variablelist>
|
68 | 83 | <varlistentry>
|
|