On Wed, Mar 9, 2016 at 12:32 PM, Gilles Darold <gilles.dar...@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 -- Sent via pgsql-hackers mailing list (firstname.lastname@example.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers