Re: 8.4.12 log truncation not working? - Mailing list pgsql-novice

From Tom Lane
Subject Re: 8.4.12 log truncation not working?
Date
Msg-id 4450.1343676061@sss.pgh.pa.us
Whole thread Raw
In response to 8.4.12 log truncation not working?  (pg noob <pgnube@gmail.com>)
List pgsql-novice
pg noob <pgnube@gmail.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

pgsql-novice by date:

Previous
From: Tom Lane
Date:
Subject: Re: very slow update query
Next
From: Andreas Kretschmer
Date:
Subject: Re: very slow update query