Received: from hanna.kiruna.se (hanna.kiruna.se [193.45.225.41]) by hub.org (8.8.8/8.7.5) with ESMTP id EAA24264 for ; Sun, 9 Aug 1998 04:19:07 -0400 (EDT) Received: from bildbasen.se (goran@a209.dial.kiruna.se [193.45.238.25]) by hanna.kiruna.se (8.8.7/8.7.2) with ESMTP id KAA28780; Sun, 9 Aug 1998 10:19:06 +0200 Sender: goran@hanna.kiruna.se Message-ID: <35CD5AE4.DE2DF2B8@bildbasen.se> Date: Sun, 09 Aug 1998 08:16:36 +0000 From: Goran Thyni Organization: JMS Bildbasen X-Mailer: Mozilla 4.05 [en] (X11; U; Linux 2.0.33 i586) MIME-Version: 1.0 To: Tom Lane CC: pgsql-interfaces@postgreSQL.org Subject: Re: thread-safe libpq and DBD::Pg References: <1623.902601037@sss.pgh.pa.us> Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Tom Lane wrote: > > Goran Thyni 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