Re: 8.4.12 log truncation not working?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pg noob <pgnube(at)gmail(dot)com>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: 8.4.12 log truncation not working?
Date: 2012-07-30 19:21:01
Message-ID: 4450.1343676061@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

pg noob <pgnube(at)gmail(dot)com> writes:
> Thank you Tom, that's basically the answer I was expecting (I had already
> found that thread you mentioned).
> But I had a slight hope for something better.

> If I understand this correctly then, if Postgres gets restarted and starts
> appending to the log that it would have truncated, then it has to wait a
> week before it rolls around to that day again before it will truncate the
> log? Because that is what I am seeing, is some log files with multiple
> weeks worth of log messages appended to the same day file.

Yeah, that's how it would work.

It occurs to me that you could probably work around the issue if you
left log_filename set the way it is and reduced log_rotation_age to
something relatively small, like 10 minutes or so. The server would
go through a rotation exercise every 10 minutes, but except at midnight,
it would decide to append because the computed filename hadn't changed.
So you'd only see the misbehavior if you restarted within 10 minutes
before midnight. (At least I think it will work like that, haven't
tried it.)

regards, tom lane

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Joseph Marlin 2012-07-30 20:12:32 WAL tuning advice
Previous Message Tom Lane 2012-07-30 19:10:35 Re: very slow update query