Laurenz Albe <[email protected]> writes:
> You say that the stderr stream is redirected to the CSV file, but that is not
> true.
> Anything that a PostgreSQL process writes to stderr will still end up in the
> *.log file.
> For example, any error message from the archive_command will end up there,
> not in the
> CSV log.
Yes. An important point here is that we must not assume that all
stderr output from a Postgres server process goes through elog.c.
It's possible to have random other stuff loaded, such as Python
modules invoked via PL/Python, and there's no guarantee that such
code won't write valuable information to stderr. Another example
that doesn't require any extension at all is that if glibc detects
corruption of malloc'd memory, it will complain about that on
stderr.
So the argument that these .log files won't contain any useful
data is false.
A conceivable improvement is to make the logger unlink a log file if
it's still empty after we stop using it. Even that would need a
switch IMO, since it might break somebody's log-archiving script.
But I'm doubtful that it's worth the trouble.
regards, tom lane