Re: [GENERAL] Querying libpq compile time options

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

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?

[ 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. +

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Perez 2006-05-13 00:40:23 Re: trigger TOASTing quicker?
Previous Message Tzahi Fadida 2006-05-12 22:00:17 Re: Google Summer of Code: Full Disjunctions

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Fuhr 2006-05-13 01:02:26 Re: DH_check return value test correct?
Previous Message Joshua D. Drake 2006-05-12 23:51:30 Re: audit table containing Select statements submitted

Browse pgsql-patches by date

  From Date Subject
Next Message spaminos-sql 2006-05-13 02:15:02 Re: [GENERAL] Querying libpq compile time options
Previous Message Bruce Momjian 2006-05-12 19:54:35 Re: [HACKERS] Question on win32 semaphore simulation