From: Bruce Momjian <pgman@candle.pha.pa.us>
> [EMAIL PROTECTED] wrote:
> > Hi all
> >
> > I am writing an app that uses libpq, but because it is threaded I want to make sure that the dynamic
> > library being used has been compiled with the right option.
> > How do I do this?
> >
> > Is there a call such as "bool PQisThreadSafe()" that I can call?
> Is this like detecting of libpq is SSL-enabled? I see PQgetssl(). Do
> we need to add a libpq function to return true/false for threading?
> Slony requires a threaded libpq, so it could do the test to prevent
> wrong configurations. It would be nice to enabled threading by default,
> but it is like SSL in that not all operating systems support it.
Yes, this is exactly the issue I have: I want to enforce at runtime that the library being
used is correct.
btw, I noticed that for some reason the prebuild linux rpms for Fedora Core 3 are compiled
without pthread support (and that's how I found out that I had to check the library on startup as I was getting strange lockups).
I think the simplest is to add a new call just like the one you described for testing for ssl and tell people
to call this function if they need the library to be thread safe.
Nicolas
> > Hi all
> >
> > I am writing an app that uses libpq, but because it is threaded I want to make sure that the dynamic
> > library being used has been compiled with the right option.
> > How do I do this?
> >
> > Is there a call such as "bool PQisThreadSafe()" that I can call?
> Is this like detecting of libpq is SSL-enabled? I see PQgetssl(). Do
> we need to add a libpq function to return true/false for threading?
> Slony requires a threaded libpq, so it could do the test to prevent
> wrong configurations. It would be nice to enabled threading by default,
> but it is like SSL in that not all operating systems support it.
Yes, this is exactly the issue I have: I want to enforce at runtime that the library being
used is correct.
btw, I noticed that for some reason the prebuild linux rpms for Fedora Core 3 are compiled
without pthread support (and that's how I found out that I had to check the library on startup as I was getting strange lockups).
I think the simplest is to add a new call just like the one you described for testing for ssl and tell people
to call this function if they need the library to be thread safe.
Nicolas