Re: Patch to implement pg_current_logfile() function

Поиск
Список
Период
Сортировка
От Gilles Darold
Тема Re: Patch to implement pg_current_logfile() function
Дата
Msg-id 7edcc2fb-5ea2-6c4b-dfb6-940e6cbd107f@dalibo.com
обсуждение исходный текст
Ответ на Re: Patch to implement pg_current_logfile() function  ("Karl O. Pinc" <kop@meme.com>)
Ответы Re: Patch to implement pg_current_logfile() function
Список pgsql-hackers
Le 19/11/2016 à 16:22, Karl O. Pinc a écrit :
> Hi Gilles,
>
> On Tue, 15 Nov 2016 15:15:52 -0600
> "Karl O. Pinc" <kop@meme.com> wrote:
>
>>> On Mon, 7 Nov 2016 23:29:28 +0100
>>> Gilles Darold <gilles.darold@dalibo.com> wrote:  
>>>>   - Do not write current_logfiles when log_collector is activated
>>>> but log_destination doesn't contained stderr or csvlog. This was
>>>> creating an empty file that can confuse the user. 
>> Whether to write current_logfiles only when there's a stderr or csvlog
>> seems dependent up on whether the current_logfiles file is for human
>> or program use.  If for humans, don't write it unless it has content.
>> If for programs, why make the program always have to check to see
>> if the file exists before reading it?  Failing to check is just one
>> more cause of bugs.
> What are your thoughts on this?  I'm leaning toward current_logfiles
> being for programs, not people.  So it should be present whenever
> logging_collector is on.

My though is that it is better to not have an empty file even if
log_collector is on. Programs can not be confused but human yes, if the
file is present but empty, someone may want to check why this file is
empty. Also having a file containing two lines with just the log format
without path is worst for confusion than having an empty file.

In other words, from a program point of view, to gather last log
filename, existence of the file or not doesn't make any difference. This
is the responsibility of the programer to cover all cases. In a non
expert user point of view, there will always the question: why this file
is empty? If the file is not present, the question will stay: how I to
get current log filename?


-- 
Gilles Darold
Consultant PostgreSQL
http://dalibo.com - http://dalibo.org




В списке pgsql-hackers по дате отправления:

Предыдущее
От: Andreas Seltenreich
Дата:
Сообщение: Re: [sqlsmith] Crash on GUC serialization
Следующее
От: Douglas Doole
Дата:
Сообщение: Re: possible optimizations - pushing filter before aggregation