Re: log files and permissions

Поиск
Список
Период
Сортировка
От Itagaki Takahiro
Тема Re: log files and permissions
Дата
Msg-id AANLkTimeEc6TCk8EJDJazNmweYBs8YXvORknptWksive@mail.gmail.com
обсуждение исходный текст
Ответ на log files and permissions  (Martin Pihlak <martin.pihlak@gmail.com>)
Ответы Re: log files and permissions  (Martin Pihlak <martin.pihlak@gmail.com>)
Список pgsql-hackers
I checked "log_file_mode GUC" patch, and found a couple of Windows-specific
and translation issues.

* fchmod() is not available on some platforms, including Windows.   fh = fopen(filename, mode);   setvbuf(fh, NULL,
LBF_MODE,0);   fchmod(fileno(fh), Log_file_mode);
 

I think umask()->fopen() is better rather than fopen()->chmod().
See codes in DoCopyTo() at commands/copy.c.

* How does the file mode work on Windows?
If it doesn't work, we should explain it in docs.
Description for .pgpass for Windows might be a help.
| http://developer.postgresql.org/pgdocs/postgres/libpq-pgpass.html
| On Microsoft Windows, ... no special permissions check is made.

* This message format is hard to translate.   ereport(am_rotating ? LOG : FATAL,         (errcode_for_file_access(),
     (errmsg("could not create%slog file \"%s\": %m",                  am_rotating ? " new " : " ", filename))));
 

It might look a duplication of codes, but I think this form is better
because we can reuse the existing translation catalogs.   if (am_rotating)       ereport(FATAL, ... "could not create
logfile ...);   else       ereport(LOG, ... "could not open new log file ...);
 

-- 
Itagaki Takahiro


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

Предыдущее
От: KaiGai Kohei
Дата:
Сообщение: Re: get_whatever_oid, part 2
Следующее
От: Itagaki Takahiro
Дата:
Сообщение: Re: patch: to_string, to_array functions