Re: Threads With Libpq Issue

From: Craig Ringer <ringerc(at)ringerc(dot)id(dot)au>
To: dinesh kumar <dineshkumar02(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Threads With Libpq Issue
Date: 2012-08-02 00:48:43
Message-ID: 5019CE6B.8090508@ringerc.id.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 08/01/2012 05:19 PM, dinesh kumar wrote:
> Respected All,
>
> This is my first post in PG-Generals. If it is not the place for these
> kind of queries, then please guide me where i need to post.
>
> I have a quick question regarding "pthread" with PostgreSQL 9.0 Libpq.
> I'm facing a problem with "Pthread" and libpq. Please find the below
> program behavoiur.
You can't share a connection between threads unless it's protected by a
lock that prevents more than one thread from using it at once.

Use multiple connections, each isolated to a single thread. See:

http://www.postgresql.org/docs/9.1/static/libpq-threading.html

--
Craig Ringer

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Craig Ringer 2012-08-02 00:50:25 Re: Threads With Libpq Issue
Previous Message Edson Richter 2012-08-02 00:04:01 Async replication: how to get an alert on failure