Skip site navigation (1) Skip section navigation (2)

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: (view raw, whole thread or download thread mbox)
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

pgsql-novice by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group