Re: Patch to implement pg_current_logfile() function

Поиск
Список
Период
Сортировка
От Robert Haas
Тема Re: Patch to implement pg_current_logfile() function
Дата
Msg-id CA+TgmoZqpzE-qv5za2dxF=1b+RLX=X14DbMso59ZVimHFehwzQ@mail.gmail.com
обсуждение исходный текст
Ответ на Patch to implement pg_current_logfile() function  (Gilles Darold <gilles.darold@dalibo.com>)
Ответы Re: Patch to implement pg_current_logfile() function  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
On Wed, Mar 9, 2016 at 12:32 PM, Gilles Darold <gilles.darold@dalibo.com> wrote:
> I choose to allow the log collector to write his current log file name
> into the lock file 'postmaster.pid'. This allow simple access to this
> information through system commands, for example:
>
> postgres@W230ST:~$ tail -n1 /usr/local/pgql-devel/data/postmaster.pid
> pg_log/postgresql-2016-03-09_152908.log
>
> Log filename is written at the 8th line position when log collection
> is active and all other information have been written to lock file.
>
> The function pg_current_logfile() use in SQL mode read the lock file
> to report the information.
>
> I don't know if there's any limitation on using postmaster.pid file to
> do that but it seems to me a bit weird to log this information to an
> other file. My first attempt was to use a dedicated file and save it
> to global/pg_current_logfile or pg_stat_tmp/pg_current_logfile but I
> think it is better to use the postmaster.pid file for that.

Gosh, why?  Piggybacking this on a file written for a specific purpose
by a different process seems like making life very hard for yourself,
and almost certainly a recipe for bugs.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company



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

Предыдущее
От: Alvaro Herrera
Дата:
Сообщение: Re: Floating point timestamps
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Small patch: fix warnings during compilation on FreeBSD