-----Original Message-----
From: pgsql-novice-owner@postgresql.org
[mailto:pgsql-novice-owner@postgresql.org]On Behalf Of Tom Lane
Sent: Monday, February 12, 2001 4:20 PM
To: Gunkel, Marc B
Cc: 'pgsql-novice@postgresql.org'
Subject: Re: [NOVICE] Multi-threaded client apps
"Gunkel, Marc B" <mgunke@sandia.gov> writes:
> Can each client thread have its own connection?
That should work.
> What happens if multiple threads share one connection? For instance, can
one
> thread open a connection and another thread close it?
Not a good idea unless you provide a mutex to ensure that only one
thread manipulates the PGconn object at a time.
Basically, libpq is thread-safe (in recent releases) but not thread-aware.
regards, tom lane