Re: Is this valid?

From: "Rick Gregory" <rgregory(at)gbgsoft(dot)com>
To: "Wei Weng" <wweng(at)kencast(dot)com>, <pgsql-interfaces(at)postgresql(dot)org>
Subject: Re: Is this valid?
Date: 2002-08-13 00:50:13
Message-ID: OOEEKDKLCHOOMNCMNFFAAEOMCHAA.rgregory@gbgsoft.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-interfaces

No, what you want to do is not thread safe.

Only 1 thread should access a Pgconn object.

See:
http://www2.ca.postgresql.org/users-lounge/docs/7.0/postgres/libpq-threading
.htm

Rick Gregory

-----Original Message-----
From: pgsql-interfaces-owner(at)postgresql(dot)org
[mailto:pgsql-interfaces-owner(at)postgresql(dot)org]On Behalf Of Wei Weng
Sent: Monday, August 12, 2002 7:26 PM
To: pgsql-interfaces(at)postgresql(dot)org
Subject: [INTERFACES] Is this valid?

I am not sure if this is the right mailing list I talk to. Please let me
know if I had violated any unwritten rules. :)

I have a global variable PGconn* m_pgconn that is the connection handle
for connecting to the postgresql database. Can I access/use the handle
from multiple threads? Say I have a thread that does some insertion
through this handle/database connection(m_pgconn) and also another
thread that do some insertion *on the same table* through this
handle(m_pgconn), will that break?

Thanks

--
Wei Weng
Network Software Engineer
KenCast Inc.

---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org

In response to

Browse pgsql-interfaces by date

  From Date Subject
Next Message William West 2002-08-13 01:53:03 Re: ECGP - varchar in struct?
Previous Message Wei Weng 2002-08-12 23:26:12 Is this valid?