X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 711EC5337F for ; Tue, 19 Apr 2005 11:46:49 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 06803-07 for ; Tue, 19 Apr 2005 14:46:43 +0000 (GMT) Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by svr1.postgresql.org (Postfix) with ESMTP id B577D5348A for ; Tue, 19 Apr 2005 11:46:41 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.1/8.13.1) with ESMTP id j3JEkked021522; Tue, 19 Apr 2005 10:46:46 -0400 (EDT) To: Pallav Kalva Cc: pgsql-admin Subject: Re: Postgres Log rotation not working in 8.0.2 In-reply-to: <42651675.4020107@deg.cc> References: <4264097D.7090808@deg.cc> <25685.1113857543@sss.pgh.pa.us> <42642131.60603@deg.cc> <26045.1113859817@sss.pgh.pa.us> <42650AC4.3010902@deg.cc> <21270.1113920596@sss.pgh.pa.us> <42651675.4020107@deg.cc> Comments: In-reply-to Pallav Kalva message dated "Tue, 19 Apr 2005 10:32:21 -0400" Date: Tue, 19 Apr 2005 10:46:46 -0400 Message-ID: <21521.1113922006@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.007 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200504/265 X-Sequence-Number: 17278 Pallav Kalva writes: > I am sorry for the confusion, what i meant was the oldest entry on the > log file was on last monday and most recent was this morning and the > file didnt rotate yet. Looking at the code, it will have decided to append not truncate because %U hadn't changed from the preceding value: * Decide whether to overwrite or append. We can overwrite if (a) * Log_truncate_on_rotation is set, (b) the rotation was triggered by * elapsed time and not something else, and (c) the computed file name * is different from what we were previously logging into. There's also a funny involved in the first rotation after startup, although in your situation case (c) would've prevented overwrite anyway: * Note: during the first rotation after forking off from the postmaster, * last_file_name will be NULL. (We don't bother to set it in the * postmaster because it ain't gonna work in the EXEC_BACKEND case.) * So we will always append in that situation, even though truncating * would usually be safe. So my advice remains "wait till this Thursday before complaining". regards, tom lane