Manfred Spraul <[EMAIL PROTECTED]> writes:
> 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.

That's definitely a problem, but "sigpipe=caller" is one of the very
worst aspects of your proposal.  In many apps the connectinfo string is
passed in more-or-less-directly from user input.  But having the user
fool with sigpipe handling would be disastrous --- either the app is
coded to handle sigpipe properly for itself, or it isn't.  If we're
going to make a hook that allows the app to tell libpq how to handle
sigpipe, then we have to make it feed in the information in some way
other than via the connectinfo string.

It strikes me that sigpipe handling will be a global affair in any
particular application --- it's unlikely that it would be correct for
some PG connections and wrong for others.  So one possibility is to make
the control variable be global (static) and thus it could be set before
creating the first PGconn.

                        regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
    (send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])

Reply via email to