Re: log_filename_prefix --> log_filename + strftime() - Mailing list pgsql-patches

From Andreas Pflug
Subject Re: log_filename_prefix --> log_filename + strftime()
Date
Msg-id 41319DF4.3060407@pse-consulting.de
Whole thread Raw
In response to Re: log_filename_prefix --> log_filename + strftime()  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: log_filename_prefix --> log_filename + strftime()
List pgsql-patches
Tom Lane wrote:
> Andreas Pflug <pgadmin@pse-consulting.de> writes:
>
>>Tom Lane wrote:
>>
>>>I can see the value of not needing any cron daemon to remove old logs.
>
>
>>No other logs on your system to purge?
>
>
> The DBA isn't necessarily also root.

Interesting this argument comes from you.. :-)

Tasks like purging old log files is certainly not a job that needs to be
implemented in the backend; instead, an external database maintenance
agent should do that.
Such an agent (pgadmin TODO list working title: pgAgent, there was a
lengthy discussion "Scheduled jobs" starting 2004-05-12), allowing
scheduled sql scripts, would delete old log files using

select pg_file_unlink(filename)
   from pg_logdir_ls
  where filetime < now() - '8 days'::interval

*if* this functionality isn't corrupted by arbitrary selectable file
name formatting.

Regards,
Andreas

pgsql-patches by date:

Previous
From: "Dave Page"
Date:
Subject: Autovbacuum Win32 service patch
Next
From: Andreas Pflug
Date:
Subject: Re: log_filename_prefix --> log_filename + strftime()