Re: Patch to implement pg_current_logfile() function

From: Gilles Darold <gilles(dot)darold(at)dalibo(dot)com>
To: "Shulgin, Oleksandr" <oleksandr(dot)shulgin(at)zalando(dot)de>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: 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 13:16:49
Message-ID: 56E2C541.9000508@dalibo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Le 11/03/2016 10:49, Shulgin, Oleksandr a écrit :
> On Thu, Mar 10, 2016 at 9:05 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us
> <mailto:tgl(at)sss(dot)pgh(dot)pa(dot)us>> wrote:
>
> Gilles Darold <gilles(dot)darold(at)dalibo(dot)com
> <mailto:gilles(dot)darold(at)dalibo(dot)com>> writes:
> > Then, should I have to use an alternate file to store the
> information or
> > implement a bidirectional communication with the syslogger?
>
> I'd just define a new single-purpose file $PGDATA/log_file_name
> or some such.
>
>
> 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. If
your external script try to reopen the log file at this moment it will
complain that file doesn't exists and looping until the file exists is
probably a bad idea.

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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2016-03-11 13:23:48 Re: Sanity checking for ./configure options?
Previous Message Stas Kelvich 2016-03-11 13:13:14 Re: Tsvector editing functions