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

From Robert Haas
Subject Re: [HACKERS] Patch to implement pg_current_logfile() function
Date
Msg-id CA+TgmoZ_oXe9GUjC=eC=kG1fcmr6kxGt--LGP4YtwhvqAs=vrw@mail.gmail.com
Whole thread Raw
In response to Re: [HACKERS] Patch to implement pg_current_logfile() function  (Michael Paquier <michael.paquier@gmail.com>)
List pgsql-hackers
On Fri, Mar 3, 2017 at 11:54 AM, Michael Paquier
<michael.paquier@gmail.com> wrote:
> On Fri, Mar 3, 2017 at 3:18 PM, Robert Haas <robertmhaas@gmail.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



pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: [HACKERS] Cost model for parallel CREATE INDEX
Next
From: Robert Haas
Date:
Subject: Re: [HACKERS] Patch to implement pg_current_logfile() function