Re: [HACKERS] Small patch for pg_basebackup argument parsing - Mailing list pgsql-hackers

From Robert Haas
Subject Re: [HACKERS] Small patch for pg_basebackup argument parsing
Date
Msg-id CA+TgmoYS2jYr3f_hVQhQgWnJz+zYVGDn8xzfTrgHGDc+rPNz3A@mail.gmail.com
Whole thread Raw
In response to Re: [HACKERS] Small patch for pg_basebackup argument parsing  (Pierre Ducroquet <p.psql@pinaraf.info>)
List pgsql-hackers
On Sat, Apr 22, 2017 at 12:46 PM, Pierre Ducroquet <p.psql@pinaraf.info> wrote:
>> Here are the general guidelines about patch submission:
>> https://wiki.postgresql.org/wiki/Submitting_a_Patch
>> And the best thing would be to register it to the next commit fest so
>> as it does not get lost:
>> https://commitfest.postgresql.org/
>
> Thank you, I added an entry in the next commit fest.

Isn't (strtol_endptr != optarg + strlen(optarg))) just a really
inefficient way of writing (strtol_endptr != '\0')?

I would be inclined to write tests like if (standby_message_timeout <
0 || strtol_endptr != optarg + strlen(optarg)) in the other order;
that is, test strtol_endptr first, and only test the other conditions
if that test passes.

I would probably also just use endptr rather than strtol_endptr, for brevity.

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



pgsql-hackers by date:

Previous
From: Craig Ringer
Date:
Subject: Re: [HACKERS] CTE inlining
Next
From: Peter Eisentraut
Date:
Subject: Re: [HACKERS] subscription worker doesn't start immediately on eabled