I wrote:
> In practice, as long as we use O_CLOEXEC
> for files opened by fd.c, that would eliminate the actual too-many-fds
> hazard. I don't object to desultorily looking around for other places
> where we might want to add it, but personally I'd be satisfied with a
> patch that CLOEXEC-ifies fd.c.
Actually, even that much coverage might be exciting. Be sure to test
patch with EXEC_BACKEND to see if it causes zapping of any files the
postmaster needs to pass down to backends.
regards, tom lane