Re: thread-safe libpq and DBD::Pg

From: Goran Thyni <goran(at)bildbasen(dot)se>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-interfaces(at)postgreSQL(dot)org
Subject: Re: thread-safe libpq and DBD::Pg
Date: 1998-08-09 08:16:36
Message-ID: 35CD5AE4.DE2DF2B8@bildbasen.se
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-interfaces

Tom Lane wrote:
>
> Goran Thyni <goran(at)bildbasen(dot)se> writes:
> > Has anyone any experience of the thread-safeness of libpq?
>
> PQconnectdb() is not thread-safe, because it scribbles temporary
> data in the static PQconninfoOptions array. You can get around
> that easily enough by not using PQconnectdb (or PQconndefaults)
> --- use PQsetdbLogin() instead. In any case the problem exists
> only if different threads try to open database connections
> at the same time.
> [...}

Tom,
thanks for the reply.
DBD::Pg dos indeed use PQconnectdb(),
but at least in my light test I get SEGV in $sth->fetch.
The problems are probably somewhere in DBDI or DBD::Pg or
somewhere in the interaction of the parts.

I am looking into how much work a "pure Perl" interface
should amount to. Using native perl IO and pgsql-fe/be-protocol
should make "pgsql-clienting" even more portable over platforms.

regards,
Göran

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter T Mount 1998-08-09 13:51:58 Re: [HACKERS] current CVS tree
Previous Message Bruce Momjian 1998-08-09 04:49:48 pgindent and prototypes

Browse pgsql-interfaces by date

  From Date Subject
Next Message Tom Lane 1998-08-09 15:33:24 Re: [INTERFACES] Re: thread-safe libpq and DBD::Pg
Previous Message Bruce Momjian 1998-08-09 03:50:55 Re: [HACKERS] thread-safe libpq and DBD::Pg