pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alvaro Herrera <alvherre@commandprompt.com>
To: Kris Kiger <kris@musicrebellion.com>
Cc: pgsql-admin@postgresql.org
Subject: Re: Built-in log rotation
Date: Mon, 19 Feb 2007 12:53:08 -0300
Message-ID: <20070219155308.GN28395@alvh.no-ip.org> (raw)
In-Reply-To: <45D9C390.6040907@musicrebellion.com>
References: <45D9C390.6040907@musicrebellion.com>

Kris Kiger wrote:
> Greetings!  I've been doing some research into log rotation software and 
> ran into this, while looking through the postgres site:
> 
> "There is a built-in log rotation program, which you can use by setting 
> the configuration parameter redirect_stderr to true in postgresql.conf."
> http://www.postgresql.org/docs/8.1/interactive/logfile-maintenance.html
> 
> My question is, how does it rotate logs?

It closes the old file and opens a new one -- new name, new file
descriptor, so the problem you mention below doesn't exist anymore.

> Does it perform a 
> copy/truncate of the logfile?  I know in older versions of postgres, if 
> you tried to move the log file, and create one with the same name, the 
> server wouldn't actually write to it without a restart...at least in 
> linux it wouldn't.

This code is "new" (only two years old).

-- 
Alvaro Herrera                                http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support



view thread (2+ messages)

Message-ID: <20070219155308.GN28395@alvh.no-ip.org>
Permalink:  ../20070219155308.GN28395@alvh.no-ip.org/
Also on:    postgresql.org/message-id/20070219155308.GN28395@alvh.no-ip.org

 · 

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-admin@postgresql.org
  Cc: alvherre@commandprompt.com, kris@musicrebellion.com
  Subject: Re: Built-in log rotation
  In-Reply-To: <20070219155308.GN28395@alvh.no-ip.org>
  References: <45D9C390.6040907@musicrebellion.com> <20070219155308.GN28395@alvh.no-ip.org>

* 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