Reopen logfile on SIGHUP - Mailing list pgsql-hackers

From Anastasia Lubennikova
Subject Reopen logfile on SIGHUP
Date
Msg-id 500a5371-ac19-ca7a-6be4-3eabd086104f@postgrespro.ru
Whole thread Raw
Responses Re: Reopen logfile on SIGHUP  (ilmari@ilmari.org (Dagfinn Ilmari Mannsåker))
Re: Reopen logfile on SIGHUP  (Greg Stark <stark@mit.edu>)
List pgsql-hackers
Large percentage of postgres installations, for example PGDG packages 
for Debian/Ubuntu,
assume by default that log management will be handled by extrernals 
tools such as logrotate.

Unfortunately such tools have no way to tell postgres to reopen log file 
after rotation
and forced to use copy-truncate strategy that leads to a loss of log 
messages which is unacceptable.

Small patch in the attachment implements logfile reopeninig on SIGHUP.
It only affects the file accessed by logging collector, which name you 
can check with pg_current_logfile().

I hope you will find this feature useful.

-- 
Anastasia Lubennikova
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company


Attachment

pgsql-hackers by date:

Previous
From: Patrick Krecker
Date:
Subject: Re: TODO item for broken \s with libedit seems fixed
Next
From: Claudio Freire
Date:
Subject: Re: [HACKERS] [PATCH] Vacuum: Update FSM more frequently