I'm working on getting libpq to function in a multi-threaded program on
Solaris and I was getting errors back from the library about
being unable to receive from the server. It turns out that on Solaris
you need to compile libpq with the -D_REENTRANT flags set so that
it defines errno to be a function call instead of a global variable.
Once I did this the program worked without any problems.
You want to consider making this flag standard (or at least provide
a configure option to compile a thread-ready version of libpq) as it
may save someone else the hassle of trying to figure out what went
wrong.
Martin