Re: Patch to implement pg_current_logfile() function

From: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
To: "Karl O(dot) Pinc" <kop(at)meme(dot)com>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, Michael Paquier <michael(dot)paquier(at)gmail(dot)com>, Gilles Darold <gilles(dot)darold(at)dalibo(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Patch to implement pg_current_logfile() function
Date: 2017-01-18 22:27:40
Message-ID: 20170118222740.4jh5eyfkpyhkxscp@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Karl O. Pinc wrote:

> @@ -511,10 +519,16 @@ int
> SysLogger_Start(void)
> {
> pid_t sysloggerPid;
> - char *filename;
>
> + /*
> + * Logging collector is not enabled. We don't know where messages are
> + * logged. Remove outdated file holding the current log filenames.
> + */
> if (!Logging_collector)
> + {
> + unlink(LOG_METAINFO_DATAFILE);
> return 0;
> + }

I thought this part was odd -- I mean, why is SysLogger_Start() being
called if the collector is not enabled? Turns out we do it and return
early if not enabled. But not in all cases -- there is one callsite in
postmaster.c that avoids the call if the collector is disabled. That
needs to be changed if we want this to work reliably.

I don't think the "abstract names" stuff is an improvement (just look at
the quoting mess in ConfigureNamesString). I think we should do without
that; at least as part of this patch. If you think there's code that
can get better because of the idea, let's see it.

--
Álvaro Herrera https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2017-01-18 22:34:56 Re: Implement targetlist SRFs using ROWS FROM() (was Changed SRF in targetlist handling)
Previous Message David G. Johnston 2017-01-18 22:25:58 Re: smallint out of range EXECUTEing prepared statement