On 8/1/13 1:42 PM, Stephen Frost wrote:
> * Alvaro Herrera (alvherre@2ndquadrant.com) wrote:
>> pgsecure_open_client() returns -1 if it can't lock the mutex. This is a
>> problem because the callers are not prepared for that return value. I
>> think it should return PGRES_POLLING_FAILED instead, after setting an
>> appropriate error message in conn->errorMessage.
>
> Ah, right, adding it there was a bit of a late addition, tbh.
Elsewhere in libpq, we use PGTHREAD_ERROR and abort if
pthread_mutex_lock fails. Shouldn't we handle that consistently?
Alternatively, if we want to just print an error message and proceed, we
should put the strerror based on the return value into the message.
Overall, the response to these kinds of errors doesn't look very well
thought through. (Not to speak of ecpg, which ignores these errors
altogether.)