Re: [GENERAL] Querying libpq compile time options

Поиск
Список
Период
Сортировка
От
Тема Re: [GENERAL] Querying libpq compile time options
Дата
Msg-id 20060513021502.11874.qmail@web32007.mail.mud.yahoo.com
обсуждение исходный текст
Ответ на Re: [GENERAL] Querying libpq compile time options  (Bruce Momjian <pgman@candle.pha.pa.us>)
Список pgsql-hackers
From: Bruce Momjian <pgman@candle.pha.pa.us>
> spaminos-sql@yahoo.com 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

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: DH_check return value test correct?
Следующее
От: "Qingqing Zhou"
Дата:
Сообщение: Re: Need some clarification