Manfred Spraul <manfred(at)colorfullife(dot)com> 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
In response to
pgsql-hackers by date
|Next:||From: Tom Lane||Date: 2003-11-02 23:25:07|
|Subject: Re: PlayStation 2 problems |
|Previous:||From: Hannu Krosing||Date: 2003-11-02 22:51:24|
|Subject: Re: Experimental patch for inter-page delay in VACUUM|