Postgres log file
Postgres log file
От:
Jessica Richard <rjessil@yahoo.com>
Дата:
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!
Re: Postgres log file
От:
Steve Francis <sfrancis@logicmonitor.com>
Дата:
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:
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 |