Re: [GENERAL] Querying libpq compile time options

From: <spaminos-sql(at)yahoo(dot)com>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: PostgreSQL-development <pgsql-hackers(at)postgreSQL(dot)org>
Subject: Re: [GENERAL] Querying libpq compile time options
Date: 2006-05-13 02:15:02
Message-ID: 20060513021502.11874.qmail@web32007.mail.mud.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers pgsql-patches

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
> spaminos-sql(at)yahoo(dot)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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message John DeSoi 2006-05-13 03:24:20 Re: call function with different select statement
Previous Message Tony Caduto 2006-05-13 01:31:43 Re: GUI Interface

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2006-05-13 04:57:05 Re: Need some clarification
Previous Message Tom Lane 2006-05-13 01:05:55 Re: DH_check return value test correct?

Browse pgsql-patches by date

  From Date Subject
Next Message Martijn van Oosterhout 2006-05-13 08:55:26 Re: [GENERAL] Querying libpq compile time options
Previous Message Bruce Momjian 2006-05-13 00:38:07 Re: [GENERAL] Querying libpq compile time options