Re: [GENERAL] Querying libpq compile time options - Mailing list pgsql-hackers

From Bruce Momjian
Subject Re: [GENERAL] Querying libpq compile time options
Date
Msg-id 200605130038.k4D0c7L02838@candle.pha.pa.us
Whole thread Raw
Responses Re: [GENERAL] Querying libpq compile time options
Re: [GENERAL] Querying libpq compile time options
List pgsql-hackers
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
usedhas been compiled with the right option.
 
> How do I do this?
> 
> Is there a call such as "bool PQisThreadSafe()" that I can call?

[ Email moved to hackers list.]

Good question.  This has come up a few times.  You can check if the
installation has threading with "pg_config --configure", and I though
there was a way to test at runtime, but looking I don't see anything.

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.

--  Bruce Momjian   http://candle.pha.pa.us EnterpriseDB    http://www.enterprisedb.com
 + If your life is a hard drive, Christ can be your backup. +


pgsql-hackers by date:

Previous
From: "Joshua D. Drake"
Date:
Subject: Re: audit table containing Select statements submitted
Next
From: Michael Fuhr
Date:
Subject: Re: DH_check return value test correct?