Re: How to clear log files

From: "Plugge, Joe R(dot)" <JRPlugge(at)west(dot)com>
To: "Campbell, Lance" <lance(at)illinois(dot)edu>, "pgsql-admin(at)postgresql(dot)org" <pgsql-admin(at)postgresql(dot)org>
Subject: Re: How to clear log files
Date: 2010-02-03 21:36:10
Message-ID: BD69807DAE0CE44CA00A8338D0FDD0830185A615A8@oma00cexmbx03.corp.westworlds.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

What platform? If in Unix/Linux, just:

cat /dev/null > postgres_logfile

or > postgres_logfile

Most running programs don't like it when you delete a file with an open file handle but you it doesn't mind if you clear it on the fly. Not sure how to do this in a Windows environment.

From: pgsql-admin-owner(at)postgresql(dot)org [mailto:pgsql-admin-owner(at)postgresql(dot)org] On Behalf Of Campbell, Lance
Sent: Wednesday, February 03, 2010 3:13 PM
To: pgsql-admin(at)postgresql(dot)org
Subject: [ADMIN] How to clear log files

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.

Is there a command that might clear a log file or force it to rotate?

Thanks,

Lance Campbell
Software Architect/DBA/Project Manager
Web Services at Public Affairs
217-333-0382

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Campbell, Lance 2010-02-03 22:09:33 pg_rotate_logfile function does not appear to work
Previous Message Scott Mead 2010-02-03 21:33:49 Re: How to clear log files