The system used to maintain a pool of persistent connected database
sessions for performance. However, the postgresql libraries seem to
have been compiled with thread-safety support disabled. Despite only
one thread using a connection from the pool at a time, a thread being
assigned a connection previouly initiated by another thread (i.e. the
first client connection causes the first thread to spawn a "page" of
connections in the pool) would no longer be able to perform requests
on that inherited connection.
Explicitely openning/closing a db connection per session solves this
problem for now, although at a performance cost, of course. I shall
resume testing with persistent connections on another box on which
I'll compile the postgresql client library with thread-safety support
eventually.