Re: Change atoi to strtol in same place - Mailing list pgsql-hackers

From Robert Haas
Subject Re: Change atoi to strtol in same place
Date
Msg-id CA+Tgmob35kNdPSv3JKHG03ey95=tXQ5gJwjXbahXNJ=9zDb-sg@mail.gmail.com
Whole thread Raw
In response to Re: Change atoi to strtol in same place  (Michael Paquier <michael@paquier.xyz>)
Responses Re: Change atoi to strtol in same place
List pgsql-hackers
On Tue, Sep 10, 2019 at 1:36 AM Michael Paquier <michael@paquier.xyz> wrote:
> The error handling is awkward.  I think that you should just call
> pg_log_error in pg_strtoint64_range instead of returning an error
> string as you do.  You could do that by passing down the option name
> to the routine, and generate a new set of error messages using that.

-1. I think it's very useful to have routines for this sort of thing
that return an error message rather than emitting an error report
directly.  That gives the caller a lot more control.

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



pgsql-hackers by date:

Previous
From: Noah Misch
Date:
Subject: Re: [HACKERS] WAL logging problem in 9.4.3?
Next
From: Alvaro Herrera from 2ndQuadrant
Date:
Subject: Re: [bug fix] Produce a crash dump before main() on Windows