Re: Patch to implement pg_current_logfile() function

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Gilles Darold <gilles(dot)darold(at)dalibo(dot)com>
Cc: "Shulgin, Oleksandr" <oleksandr(dot)shulgin(at)zalando(dot)de>, Robert Haas <robertmhaas(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Patch to implement pg_current_logfile() function
Date: 2016-03-11 14:22:03
Message-ID: 676.1457706123@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Gilles Darold <gilles(dot)darold(at)dalibo(dot)com> writes:
> Le 11/03/2016 10:49, Shulgin, Oleksandr a crit :
>> Would it make sense to have it as a symlink instead?

> The only cons I see is that it can be more "difficult" with some
> language to gather the real path, but do we really need it? There is
> also little time where the symlink doesn't exist, this is when it needs
> to be removed before being recreated to point to the new log file.

Yeah, a symlink is impossible to update atomically (on most platforms
anyway). Plain file containing the pathname seems better.

Another point is that we might not necessarily want *only* the pathname in
there. postmaster.pid has accreted more stuff over time, and this file
might too. I can see wanting the syslogger PID in there, for example,
so that onlookers can detect a totally stale file. (Not proposing this
right now, just pointing out that it's a conceivable future feature.)

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Petr Jelinek 2016-03-11 14:24:48 Re: [PATCH] Logical decoding support for sequence advances
Previous Message Julien Rouhaud 2016-03-11 14:16:19 Re: auto_explain sample rate