Re: Patch to implement pg_current_logfile() function - Mailing list pgsql-hackers

From Gilles Darold
Subject Re: Patch to implement pg_current_logfile() function
Date
Msg-id 56E2C541.9000508@dalibo.com
Whole thread Raw
In response to Re: Patch to implement pg_current_logfile() function  ("Shulgin, Oleksandr" <oleksandr.shulgin@zalando.de>)
Responses Re: Patch to implement pg_current_logfile() function
List pgsql-hackers
Le 11/03/2016 10:49, Shulgin, Oleksandr a écrit :
On Thu, Mar 10, 2016 at 9:05 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
Gilles Darold <gilles.darold@dalibo.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

pgsql-hackers by date:

Previous
From: Stas Kelvich
Date:
Subject: Re: Tsvector editing functions
Next
From: Robert Haas
Date:
Subject: Re: Sanity checking for ./configure options?