Index: doc/src/sgml/libpq.sgml =================================================================== RCS file: /projects/cvsroot/pgsql/doc/src/sgml/libpq.sgml,v retrieving revision 1.275 diff -C6 -r1.275 libpq.sgml *** doc/src/sgml/libpq.sgml 10 Jan 2009 20:14:30 -0000 1.275 --- doc/src/sgml/libpq.sgml 22 Jan 2009 17:13:09 -0000 *************** *** 59,72 **** is obtained from the function PQconnectdb or PQsetdbLogin. Note that these functions will always return a non-null object pointer, unless perhaps there is too little memory even to allocate the PGconn object. The PQstatus function should be called to check whether a connection was successfully made before queries are sent ! via the connection object. ! PQconnectdbPQconnectdb Makes a new connection to the database server. --- 59,84 ---- is obtained from the function PQconnectdb or PQsetdbLogin. Note that these functions will always return a non-null object pointer, unless perhaps there is too little memory even to allocate the PGconn object. The PQstatus function should be called to check whether a connection was successfully made before queries are sent ! via the connection object. For windows applications, destroying a ! PGconn can be expensive in a few cases. ! ! ! On windows, libpq issues a WSAStartup and WSACleanup on a per ! connection basis. Each WSAStartup increments an internal reference ! count which is decremented by WSACleanup. When calling WSACleanup ! with a reference count of zero, all resources will be freed and all ! DLLs will be unloaded. This is an expensive operation that can take ! as much as 300ms. The overhead can be seen if an application does ! not call WSAStartup and it closes its last PGconn. To avoid this, ! an application should manually call WSAStartup. ! ! PQconnectdbPQconnectdb Makes a new connection to the database server.