Re: Patch to implement pg_current_logfile() function

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
Cc: Gilles Darold <gilles(dot)darold(at)dalibo(dot)com>, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, "Karl O(dot) Pinc" <kop(at)meme(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Patch to implement pg_current_logfile() function
Date: 2017-03-04 08:54:29
Message-ID: CA+TgmoZ_oXe9GUjC=eC=kG1fcmr6kxGt--LGP4YtwhvqAs=vrw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Mar 3, 2017 at 11:54 AM, Michael Paquier
<michael(dot)paquier(at)gmail(dot)com> wrote:
> On Fri, Mar 3, 2017 at 3:18 PM, Robert Haas <robertmhaas(at)gmail(dot)com> wrote:
>> Hopefully I haven't broken anything; please let me know if you
>> encounter any issues.
>
> Reading what has just been committed...
>
> + /*
> + * No space found, file content is corrupted. Return NULL to the
> + * caller and inform him on the situation.
> + */
> + elog(ERROR,
> + "missing space character in \"%s\"", LOG_METAINFO_DATAFILE);
> + break;
> There is no need to issue a break after a elog(ERROR).

True, but it's not wrong, either. We do it all the time.

git grep -A2 elog.*ERROR
/break
<press n until you get bored>

The fact that the comment doesn't match the code, though, is wrong. Oops.

> + * No newlinei found, file content is corrupted. Return NULL to
> s/newlinei/newline/

That's also a problem, and that comment also refers to returning,
which we don't.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2017-03-04 08:56:54 Re: Patch to implement pg_current_logfile() function
Previous Message Robert Haas 2017-03-04 08:50:51 Re: Cost model for parallel CREATE INDEX