pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Rafael Martinez <r.m.guerrero@usit.uio.no>
To: Amit Kapila <amit.kapila@huawei.com>
Cc: sari.thiele@usit.uio.no
Cc: pgsql-bugs@postgresql.org
Subject: Re: BUG #7890: wrong behaviour using pg_rotate_logfile() with parameter	log_truncate_on_rotation = on
Date: Mon, 18 Feb 2013 15:58:08 +0100
Message-ID: <51224180.6030500@usit.uio.no> (raw)
In-Reply-To: <00a201ce0de5$fc2f1920$f48d4b60$@kapila@huawei.com>
References: <E1U7PZN-0000zg-NC@wrigleys.postgresql.org>
	<00a201ce0de5$fc2f1920$f48d4b60$@kapila@huawei.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

-----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



view thread (11+ messages)  latest in thread

Message-ID: <51224180.6030500@usit.uio.no>
Permalink:  ../51224180.6030500@usit.uio.no/
Also on:    postgresql.org/message-id/51224180.6030500@usit.uio.no

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: r.m.guerrero@usit.uio.no, amit.kapila@huawei.com, sari.thiele@usit.uio.no
  Subject: Re: BUG #7890: wrong behaviour using pg_rotate_logfile() with parameter	log_truncate_on_rotation = on
  In-Reply-To: <51224180.6030500@usit.uio.no>
  References: <E1U7PZN-0000zg-NC@wrigleys.postgresql.org> <00a201ce0de5$fc2f1920$f48d4b60$@kapila@huawei.com> <51224180.6030500@usit.uio.no>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox