Re: Proposal for internal Numeric to Uint64 conversion function. - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Proposal for internal Numeric to Uint64 conversion function.
Date
Msg-id 799416.1647547347@sss.pgh.pa.us
Whole thread Raw
In response to Re: Proposal for internal Numeric to Uint64 conversion function.  (Greg Stark <stark@mit.edu>)
Responses Re: Proposal for internal Numeric to Uint64 conversion function.
List pgsql-hackers
Greg Stark <stark@mit.edu> writes:
> On Fri, 11 Mar 2022 at 15:17, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> The patch as-presented isn't very compelling for
>> lack of callers of the new function

> Tom, are you saying you think we're not interested in just adding this
> function unless it's part of this refactoring?

Pretty much, yeah.  I'm way more interested in cleaning up the code
we have than in making things prettier for hypothetical future
call sites.  In particular, the problem with writing an API in a
vacuum is that you have little evidence that it's actually useful
as given (e.g., did you handle error cases in a useful way).  If we
create a numeric_to_int64 that is actually used right away by some
existing callers, then we've got some evidence that we did it right;
and then introducing a parallel numeric_to_uint64 is less of a leap
of faith.

            regards, tom lane



pgsql-hackers by date:

Previous
From: Greg Stark
Date:
Subject: Re: proposal: enhancing plpgsql debug API - returns text value of variable content
Next
From: Nathan Bossart
Date:
Subject: Re: Optimize external TOAST storage