That wouldn't offer a solution for people who use SIGPIPE for other things during the lifetime of the program (after creating the connection) and if a SIGPIPE handler is called due to the connection, the handler won't be expecting the source, and polling signal for state is essentially what you do now. Instead, I propose a PQsigpipeOK/PQacceptsigpipe/PQrecvsigpipe(PGconn*) or something to that effect which skips this check for the connection. That way, programmers are aware that the connection could call their SIGPIPE handler because they explicitly request it and the library remains backwards-compatible.
If I understand libpq sources correctly, the first packets are send during connection setup - PQsigpipeOK(PGconn *) would be too late.
That's why I added "sigpipe=caller" as a new flag for PQconnectdb.
-- Manfred
---------------------------(end of broadcast)--------------------------- TIP 2: you can get off all lists at once with the unregister command (send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])