Re: [HACKERS] libpq questions...when threads collide - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [HACKERS] libpq questions...when threads collide
Date
Msg-id 4555.945038510@sss.pgh.pa.us
Whole thread Raw
In response to libpq questions...when threads collide  (Don Baccus <dhogaza@pacifier.com>)
Responses Re: [HACKERS] libpq questions...when threads collide
List pgsql-hackers
Don Baccus <dhogaza@pacifier.com> writes:
> Despite the thread unsafeness
> of PQsetdb et al, I've never seen a failure in this environment
> and I've never heard of folks experiencing such a failure.

The *only* thing that's actually thread-unsafe, AFAIR, is
PQconnectdb's use of a global array for connection parameters.
PQsetdb/setdbLogin are thread-safe; so just use them instead.

At least that was true before the async-connection code got added.
I haven't looked at that to see if it introduces any problems.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Don Baccus
Date:
Subject: libpq questions...when threads collide
Next
From: The Hermit Hacker
Date:
Subject: Re: [HACKERS] 6.6 release