Skip site navigation (1) Skip section navigation (2)

Using libpq in a multithreaded environment

From: Rini Dutta <rinid(at)rocketmail(dot)com>
To: pgsql-interfaces(at)postgresql(dot)org
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Using libpq in a multithreaded environment
Date: 2000-02-25 16:47:31
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackerspgsql-interfaces
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 ?


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.


pgsql-hackers by date

Next:From: Bruce MomjianDate: 2000-02-25 16:54:40
Subject: Re: [SQL] how to create index on timestamp field in pre v7 database
Previous:From: Tom LaneDate: 2000-02-25 16:36:23
Subject: Re: missing function datetime()

pgsql-interfaces by date

Next:From: Tom LaneDate: 2000-02-25 18:19:34
Subject: Re: [HACKERS] Using libpq in a multithreaded environment
Previous:From: Tom LaneDate: 2000-02-25 04:48:29
Subject: Re: [INTERFACES] arrays of varchar and "

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group