On Wed, Jul 24, 2019 at 04:57:42PM +1200, David Rowley wrote: > I'd like to put my vote not to add this complex code to each option > validation that requires an integer number. I'm not sure there > currently is a home for it, but if there was, wouldn't it be better > writing a function that takes a lower and upper bound and sets some > output param with the value and returns a bool to indicate if it's > within range or not?
Perhaps. When I see this patch calling strtol basically only for 10 as base, this reminds me of Fabien Coelho's patch refactor all the strtoint routines we have in the code: https://commitfest.postgresql.org/23/2099/ The conclusion that we are reaching on the thread is to remove more dependencies on strtol that we have in the code, and replace it with our own, more performant wrappers. This thread makes me wondering that we had better wait before doing this move. -- Michael
signature.asc
Description: PGP signature