Received: from web2903.mail.yahoo.com (web2903.mail.yahoo.com [128.11.68.46]) by hub.org (8.9.3/8.9.3) with SMTP id LAA29382 for ; Fri, 25 Feb 2000 11:47:32 -0500 (EST) (envelope-from rinid@rocketmail.com) Received: (qmail 18955 invoked by uid 60001); 25 Feb 2000 16:47:31 -0000 Message-ID: <20000225164731.18954.qmail@web2903.mail.yahoo.com> Received: from [206.114.238.111] by web2903.mail.yahoo.com; Fri, 25 Feb 2000 08:47:31 PST Date: Fri, 25 Feb 2000 08:47:31 -0800 (PST) From: Rini Dutta Subject: Using libpq in a multithreaded environment To: pgsql-interfaces@postgresql.org Cc: pgsql-hackers@postgresql.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Hi, I need to use libpq in a multithreaded environment. Ideally I would like to open a single connection to the database and use that for all threads. I just discovered that the PGconn returned when a connection is opened is usable for only one thread since it also seems to store the result (PGresult *) and the errorMessage. Could you tell me if there is a way to use one connection in multiple threads, or whether I will need to necessarily open one Connection per thread ? Which is the preferred course of action ? Thanks, Rini ps : Sorry, but I've been unable to search the archives before sending this mail. For the last three days each time I try a search I get the folllowing message : The document contained no data. Try again later or contact the server's administrator. __________________________________________________ Do You Yahoo!? Talk to your friends online with Yahoo! Messenger. http://im.yahoo.com