David Ford <david@blue-labs.org> writes:
> problem. Remember a month ago when I had a huge database that I had to
> upgrade, I had no disk space to export it to and when the old version of
> psql ran out of memory it crashed? The backend continued to push query
> data out the closed pipe until the backend was forcibly closed or the
> query completed. Naturally this caused considerable spammage on the
> console.
This has been discussed before. Don't bother proposing that backends
should use the default handling of SIGPIPE, because that won't be
accepted. A safe limited solution would be to keep backend libpq from
emitting multiple consecutive "broken pipe" reports to stderr.
A better-sounding solution that might have unforeseen side effects
is to set QueryCancel as soon as we see a nonrecoverable-looking
send() error. This is on the TODO list but no one's gotten round to
doing anything about it yet.
regards, tom lane