Re: Change atoi to strtol in same place

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Michael Paquier <michael(at)paquier(dot)xyz>
Cc: Joe Nelson <joe(at)begriffs(dot)com>, Alvaro Herrera from 2ndQuadrant <alvherre(at)alvh(dot)no-ip(dot)org>, David Rowley <david(dot)rowley(at)2ndquadrant(dot)com>, Tomas Vondra <tomas(dot)vondra(at)2ndquadrant(dot)com>, Surafel Temesgen <surafel3000(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Change atoi to strtol in same place
Date: 2019-09-10 12:03:32
Message-ID: CA+Tgmob35kNdPSv3JKHG03ey95=tXQ5gJwjXbahXNJ=9zDb-sg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Sep 10, 2019 at 1:36 AM Michael Paquier <michael(at)paquier(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera from 2ndQuadrant 2019-09-10 12:30:17 Re: [bug fix] Produce a crash dump before main() on Windows
Previous Message Noah Misch 2019-09-10 11:45:17 Re: [HACKERS] WAL logging problem in 9.4.3?