Greetings, Does pg open its logfile every time it writes or does it open the file and hold it open as long as the postmaster is running? Do I have to stop the postmaster to rotate the logfile out or can I just move or delete it at any time and pg will create a new logfile the next time it writes? Thank you, Matthew
Matthew Hagerty <matthew@venux.net> writes:
> Does pg open its logfile every time it writes or does it open the file and
> hold it open as long as the postmaster is running?
If you do the usualpostmaster >logfile 2>&1
then the logfile is actually opened by the shell before the postmaster
ever starts; the postmaster has no way to close and re-open it. So,
no, you can't rotate the logfile transparently in that scenario.
I believe there's a compile-time option to use syslog instead, which
probably works better for this (assuming you have syslog).
regards, tom lane
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера