Обсуждение: Postgres log file
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!
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!
On Linux at least - not sure about Windows - deleting a file does not remove it from the file system until there are nomore processes holding the file open.<br /> So while postgres holds the file open, it can keep writing to it happily.<br/> You won't be able to see the file in the directory, and the space won't be freed. You can find such thingswith the "find"command by looking for files with a link count of zero.<br /><br /><br /> On 10/15/2010 11:03 AM, JessicaRichard wrote: <blockquote cite="mid:165713.55278.qm@web111313.mail.gq1.yahoo.com" type="cite"><style type="text/css"><!--DIV {margin:0px;} --></style><div style="font-family: times new roman,new york,times,serif; font-size:12pt;">I am curious about this scenario:<br /><br /> What is going to happen when a server is running and the Postgreslog file is accidentally deleted or renamed? The server will have no place to write its log entries obviously..what else?.<br /><br /> Is there any way to check within Postgres what the current log name (with a particulartime stamp when rotated last time) is so that a file with a correct matching name can be manually created?<br/><br /> For this situation, what is the proper way to get the server to write to a new log file without havingto bounce the Postgres server itself?<br /><br /> Thanks!<br /><br /><br /></div><br /></blockquote><br /><br /><divclass="moz-signature">-- <br /><style type="text/css">.sig, .sig a, .sig td { font: 12px Arial; color: DarkBlue; white-space:nowrap; vertical-align: top; text-align: left; }.sig img { border: 0pt none; }.sig a { font: 11px Arial; }.sig.back { color: rgb(255, 255, 255); background-color: DarkBlue; text-decoration: none; }.sig .right { text-align: right;}.sig .border { border: 1px solid DarkBlue; margin: 5px; border-collapse: collapse; }.sig .bottom { vertical-align:bottom; }.sig p { clear: both; margin: 2px; }</style><div class="sig"><table class="border"><tbody><tr><tdclass="back"> <b>Steve Francis</b></td><td class="back" style="width: 30px;"><br /></td><tdclass="back" style="text-align: right;"><b>LogicMonitor LLC</b></td></tr><tr><td><br /></td><td><br /></td><tdclass="right"><br /></td></tr><tr><td class="bottom"><a class="moz-txt-link-abbreviated" href="mailto:sfrancis@logicmonitor.com">sfrancis@logicmonitor.com</a><br/> Monitoring Made Easy<br /><a href="http://www.logicmonitor.com"target="_blank">www.logicmonitor.com</a></td><td><br /></td><td class="bottom" style="text-align:right;"> Ph: 1 888 41 LOGIC x500<br /> Ph: 1 805 698 0770</td></tr></tbody></table><p> <br /></div></div>