This is half of an item in TODO list. I patch this because now pgbench is
threaded in Win32, so it is better to check thread safety of libpq.dll.
Patch ecpg could be done in a similar way, but I am not sure how we will
use this function there ...
Regards,
Qingqing
---
Index: fe-connect.c
===
RCS file: /projects/cvsroot/pgsql/src/interfaces/libpq/fe-connect.c,v
retrieving revision 1.324
diff -c -r1.324 fe-connect.c
*** fe-connect.c22 Nov 2005 18:17:32 - 1.324
--- fe-connect.c3 Dec 2005 05:15:29 -
***
*** 2860,2865
--- 2860,2875
return PG_PROTOCOL_MAJOR(conn-pversion);
}
+ bool
+ PQthreadSafe(void)
+ {
+ #ifdef ENABLE_THREAD_SAFETY
+ return true;
+ #else
+ return false;
+ #endif
+ }
+
int
PQserverVersion(const PGconn *conn)
{
Index: libpq-fe.h
===
RCS file: /projects/cvsroot/pgsql/src/interfaces/libpq/libpq-fe.h,v
retrieving revision 1.122
diff -c -r1.122 libpq-fe.h
*** libpq-fe.h 23 Nov 2005 04:23:28 - 1.122
--- libpq-fe.h 3 Dec 2005 05:15:29 -
***
*** 264,269
--- 264,270
extern const char *PQparameterStatus(const PGconn *conn,
const char *paramName);
extern intPQprotocolVersion(const PGconn *conn);
+ extern bool PQthreadSafe(void);
extern intPQserverVersion(const PGconn *conn);
extern char *PQerrorMessage(const PGconn *conn);
extern intPQsocket(const PGconn *conn);
---(end of broadcast)---
TIP 6: explain analyze is your friend