Re: [HACKERS] Logfile rotation - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [HACKERS] Logfile rotation
Date
Msg-id 26316.946311249@sss.pgh.pa.us
Whole thread Raw
In response to Logfile rotation  (Matthew Hagerty <matthew@venux.net>)
List pgsql-hackers
Matthew Hagerty <matthew@venux.net> writes:
> Does pg open its logfile every time it writes or does it open the file and
> hold it open as long as the postmaster is running?

If you do the usualpostmaster >logfile 2>&1
then the logfile is actually opened by the shell before the postmaster
ever starts; the postmaster has no way to close and re-open it.  So,
no, you can't rotate the logfile transparently in that scenario.

I believe there's a compile-time option to use syslog instead, which
probably works better for this (assuming you have syslog).
        regards, tom lane


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: [HACKERS] memory dilemma
Next
From: "Ansley, Michael"
Date:
Subject: RE: [HACKERS] Explain plan output