"Nigel J. Andrews" <nandrews@investsystems.co.uk> writes:
> Obviously, that's not entirely usable if connections are being made
> and dropped by applications. So how about elog() sticking the backend
> slot number into all messages? Is that sort of information available
> in elog?
No; in fact there is no backend slot number assigned yet during startup
processing. But elog already can record the process PID, and that's
probably what you'd want to use to correlate these messages. I'm
envisioning log entries like
timestamp [PID] LOG: received connection from foo.bar port 12345
timestamp [PID] FATAL: Invalid length of startup packet
The PID in the first of these messages would already be the PID of the
forked-off child, so there would be a clear correlation to the following
failure message, even if other connection requests were being processed
at about the same time.
regards, tom lane