pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Gabriel Parrondo <gabriel.parrondo@ultragestion.com.ar>
To: pgsql-admin@postgresql.org
Subject: Re: How to clear log files
Date: Wed, 03 Feb 2010 21:46:39 -0300
Message-ID: <1265244399.2838.4.camel@debian2> (raw)
In-Reply-To: <B10E6810AC2A2F4EA7550D072CDE876004B2E09C@SAB-FENWICK.sab.uiuc.edu>
References: <B10E6810AC2A2F4EA7550D072CDE876004B2E09C@SAB-FENWICK.sab.uiuc.edu>

El mié, 03-02-2010 a las 15:12 -0600, Campbell, Lance escribió:
> PostgreSql:8.4.1
> 
> Is there a way for me to tell postgres to clear the log file.
> Example:  I have log files created with names corresponding to the
> days of the week.  This way they overwrite each other every week.
> When I deploy software enhancements I would like to clear the log file
> for the day without having to stop postgres.  This way anything I see
> I know was after the deployment of my enhancements.  I tried to just
> delete the file with postgres running.  I found that it did not
> recreate the log file so I was forced to restart postgres.
> 
Actually, when you delete an opened file it isn't really deleted.
Whatever program opened it can still read/write to it using the file
descriptor.

> Is there a command that might clear a log file or force it to rotate?
Truncating it like this should work:
echo > /path/to/logfile

There's probably a better way though.






view thread (4+ messages)

Message-ID: <1265244399.2838.4.camel@debian2>
Permalink:  ../1265244399.2838.4.camel@debian2/
Also on:    postgresql.org/message-id/1265244399.2838.4.camel@debian2

 · 

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 using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: gabriel.parrondo@ultragestion.com.ar
  Subject: Re: How to clear log files
  In-Reply-To: <1265244399.2838.4.camel@debian2>

* 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