Re: is it possible to delete the psql log while psql is - Mailing list pgsql-general

From Csaba Nagy
Subject Re: is it possible to delete the psql log while psql is
Date
Msg-id 1134049424.4779.259.camel@coppola.muc.ecircle.de
Whole thread Raw
In response to is it possible to delete the psql log while psql is running?  (Gábor Farkas <gabor@nekomancer.net>)
Responses Re: is it possible to delete the psql log while psql is
List pgsql-general
Gabor,

Short answer: you'll have to restart.

Long answer:
It depends a lot on your OS... on windows I bet you can't delete it, the
OS will prevent you to do it (you'll get some error).
On Linux you can delete it, but the postgres server will still use it
even if you can't access it anymore (won't show up with ls)... the file
will be really deleted when the postgres server process dies. The only
effect you'll achieve is that you won't be able to access it anymore...
And if you want to do it for freeing up disk space, it won't do that.
So you better set up some kind of log rotation (I think you can do it
from the postgres config file), and restart your server.

Cheers,
Csaba.

On Thu, 2005-12-08 at 11:28, Gábor Farkas wrote:
> hi,
>
> i'd like to delete the postgresql log file
> (resides in /var/log/pgsql/postgres),
> because it has become too big.
>
> can i simply delete the file while postres is running?
>
> or do i have to stop postgres first, and only delete the logfile after that?
>
> thanks,
> gabor
>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: Don't 'kill -9' the postmaster


pgsql-general by date:

Previous
From: Gábor Farkas
Date:
Subject: is it possible to delete the psql log while psql is running?
Next
From: Mike Rylander
Date:
Subject: Re: Memory Leakage Problem