pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Rini Dutta <rinid@rocketmail.com>
To: pgsql-interfaces@postgresql.org
Cc: pgsql-hackers@postgresql.org
Subject: Using libpq in a multithreaded environment
Date: Fri, 25 Feb 2000 08:47:31 -0800 (PST)
Message-ID: <20000225164731.18954.qmail@web2903.mail.yahoo.com> (raw)

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



view thread (2+ messages)  latest in thread

Message-ID: <20000225164731.18954.qmail@web2903.mail.yahoo.com>
Permalink:  ../20000225164731.18954.qmail@web2903.mail.yahoo.com/
Also on:    postgresql.org/message-id/20000225164731.18954.qmail@web2903.mail.yahoo.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-interfaces@postgresql.org
  Cc: rinid@rocketmail.com, pgsql-hackers@postgresql.org
  Subject: Re: Using libpq in a multithreaded environment
  In-Reply-To: <20000225164731.18954.qmail@web2903.mail.yahoo.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox