Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 8B5EF1337B67 for ; Fri, 15 Oct 2010 15:20:59 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 02852-10 for ; Fri, 15 Oct 2010 18:20:52 +0000 (UTC) X-Greylist: delayed 00:05:36.560516 by SQLgrey-1.7.6 Received: from mail-pw0-f46.google.com (mail-pw0-f46.google.com [209.85.160.46]) by mail.postgresql.org (Postfix) with ESMTP id B21EE1337B64 for ; Fri, 15 Oct 2010 15:20:51 -0300 (ADT) Received: by pwj4 with SMTP id 4so209901pwj.19 for ; Fri, 15 Oct 2010 11:20:51 -0700 (PDT) Received: by 10.142.241.16 with SMTP id o16mr941010wfh.44.1287166514188; Fri, 15 Oct 2010 11:15:14 -0700 (PDT) Received: from [192.168.1.128] (shield1.sb.becknet.com [206.83.1.2]) by mx.google.com with ESMTPS id p8sm16158978wff.4.2010.10.15.11.15.13 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 15 Oct 2010 11:15:13 -0700 (PDT) Message-ID: <4CB89A49.80208@logicmonitor.com> Date: Fri, 15 Oct 2010 11:15:37 -0700 From: Steve Francis User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.9) Gecko/20100915 Lightning/1.0b2 Thunderbird/3.1.4 MIME-Version: 1.0 To: pgsql-admin@postgresql.org Subject: Re: Postgres log file References: <1287085384.1684.52.camel@tony1.localdomain> <165713.55278.qm@web111313.mail.gq1.yahoo.com> In-Reply-To: <165713.55278.qm@web111313.mail.gq1.yahoo.com> X-Enigmail-Version: 1.1.1 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.176 tagged_above=-10 required=5 tests=BAYES_00=-1.9, HTML_MESSAGE=0.001, MIME_HTML_ONLY=0.723, RCVD_IN_DNSWL_NONE=-0.0001 X-Spam-Level: X-Archive-Number: 201010/129 X-Sequence-Number: 35870 On Linux at least - not sure about Windows - deleting a file does not remove it from the file system until there are no more processes holding the file open.
So while postgres holds the file open, it can keep writing to it happily.
You won't be able to see the file in the directory, and the space won't be freed. You can find such things with the "find"command by looking for files with a link count of zero.


On 10/15/2010 11:03 AM, Jessica Richard wrote:
I am curious about this scenario:

What is going to happen when a server is running and the Postgres log file is accidentally deleted or renamed?  The server will have no place to write its log entries obviously.. what else?.

Is there any way to check within Postgres what the current log name (with a particular time stamp when rotated last time) is so that a file with a correct  matching name can be manually created?

For this situation, what is the proper way to get the server to write to a new log file without having to bounce the Postgres server itself?

Thanks!





--
 Steve Francis
LogicMonitor LLC



sfrancis@logicmonitor.com
Monitoring Made Easy
www.logicmonitor.com

Ph: 1 888 41 LOGIC x500
Ph: 1 805 698 0770