I'm looking for feedback from anybody who has used pg in a multi-threaded program, particularly one in which several threads each open a database connection.
It's documented to work in that scenario, but I'm interested in anybody who can share some real-world with that.
Take a look at Slony-I.
Multithreaded client applications are a headache for themself, since the PostgreSQL client libraries are not built threadsafe by default, cannot be built threadsafe on all platforms, and even if we thought about some platforms being threadsafe buildable, some underlying authentication libs are sometimes not. Someone testing Slony was lately bitten by a non-threadsafe libkrb5 even if he does not use kerberos authentication at all. Having libpq linked against it was enough to coredump slon.
It's more or less a nightmare, and we definitely need to cleanup that mess anytime soon.
Jan
-- #======================================================================# # It's easier to get forgiveness for being wrong than for being right. # # Let's break this rule - forgive me. # #================================================== JanWieck@Yahoo.com #
---------------------------(end of broadcast)--------------------------- TIP 4: Don't 'kill -9' the postmaster