Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1U7SAe-0004H0-8Q for pgsql-bugs@arkaria.postgresql.org; Mon, 18 Feb 2013 14:58:20 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1U7SAd-0005Iq-NK for pgsql-bugs@arkaria.postgresql.org; Mon, 18 Feb 2013 14:58:19 +0000 Received: from makus.postgresql.org ([2001:4800:7903:4::125]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1U7SAc-0005Ik-KE for pgsql-bugs@postgresql.org; Mon, 18 Feb 2013 14:58:18 +0000 Received: from mail-out4.uio.no ([2001:700:100:10::15]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1U7SAa-0006YE-3c for pgsql-bugs@postgresql.org; Mon, 18 Feb 2013 14:58:18 +0000 Received: from mail-mx1.uio.no ([129.240.10.29]) by mail-out4.uio.no with esmtp (Exim 4.80.1) (envelope-from ) id 1U7SAX-0000wc-Cj; Mon, 18 Feb 2013 15:58:13 +0100 Received: from bbking.uio.no ([129.240.6.205]) by mail-mx1.uio.no with esmtpsa (TLSv1:DHE-RSA-AES256-SHA:256) user rafael (Exim 4.80) (envelope-from ) id 1U7SAW-00084F-Us; Mon, 18 Feb 2013 15:58:13 +0100 Message-ID: <51224180.6030500@usit.uio.no> Date: Mon, 18 Feb 2013 15:58:08 +0100 From: Rafael Martinez Organization: University of Oslo User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.12) Gecko/20130108 Thunderbird/10.0.12 MIME-Version: 1.0 To: Amit Kapila CC: sari.thiele@usit.uio.no, pgsql-bugs@postgresql.org Subject: Re: BUG #7890: wrong behaviour using pg_rotate_logfile() with parameter log_truncate_on_rotation = on References: <00a201ce0de5$fc2f1920$f48d4b60$@kapila@huawei.com> In-Reply-To: <00a201ce0de5$fc2f1920$f48d4b60$@kapila@huawei.com> X-Enigmail-Version: 1.4 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-UiO-Ratelimit-Test: rcpts/h 3 msgs/h 1 sum rcpts/h 3 sum msgs/h 1 total rcpts 661 max rcpts/h 23 ratelimit 0 X-UiO-Spam-info: not spam, SpamAssassin (score=-8.6, required=5.0, autolearn=disabled, RP_MATCHES_RCVD=-0.55, UIO_MAIL_IS_INTERNAL=-5, UIO_PGP_SIGNED=-3, uiobl=NO, uiouri=NO) X-UiO-Scanned: 0DE58381CEDC229EB0B5AA76DD513A95A9EF87BB X-UiO-SPAM-Test: remote_host: 129.240.6.205 spam_score: -85 maxlevel 80 minaction 1 bait 0 mail/h: 1 total 706 max/h 23 blacklist 0 greylist 1 ratelimit 0 X-Pg-Spam-Score: -2.5 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 02/18/2013 03:41 PM, Amit Kapila wrote: [...........] > Why you think this is wrong behavior, do you expect any time you > call pg_rotate_logfile(), it should truncate the file if > log_truncate_on_rotation is on? I think if you are expecting such > behavior, it might not be right expectation, because it considers > the the time and log_filename format as well. > Hello I agree with Sari in this report. If you call pg_rotate_logfile() AND log_truncate_on_rotation is on, the logfile should be truncated. This should happen even if the logfile name does not change during rotation, and even if log_rotation_age / log_rotation_size are defined. According to the documentation: "log_truncate_on_rotation ... When logging_collector is enabled, this parameter will cause PostgreSQL to truncate (overwrite), rather than append to, any existing log file of the same name ..." "... pg_rotate_logfile signals the log-file manager to switch to a new output file immediately" regards, - -- Rafael Martinez Guerrero Center for Information Technology University of Oslo, Norway PGP Public Key: http://folk.uio.no/rafael/ -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (GNU/Linux) iEYEARECAAYFAlEiQX8ACgkQBhuKQurGihRJLwCeIrZFkLDuAIOK21k5Ez4jIV2x WgcAnAxJYJkfH2+uzb778AH8QL1qGRjq =a4kS -----END PGP SIGNATURE----- -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs