Re: Log rotation

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: Fernando Nasser <fnasser@redhat.com>
Cc: pgsql-hackers@postgresql.org
Date: 2004-03-12T01:23:46Z
Lists: pgsql-hackers
Fernando Nasser <fnasser@redhat.com> writes:
> Please remind me again why the postmaster cannot close and open the log 
> file when it receives a SIGHUP (to re-read configuration)?

(a) Because it never opened it in the first place --- the log file is
whatever was passed as stderr.

(b) Because it would not be sufficient to make the postmaster itself
close and reopen the file; every child process would have to do so also.
Doing this in any sort of synchronized fashion seems impossible.

It's much cleaner to have stderr be a pipe to some separate collector
program that can handle log rotation (ie, the Apache solution).

			regards, tom lane