David N. Welton
David N. Welton
The reason I started looking at it is that my complex query with some sums returns a few numbers as binaries like . It's not that big a deal to...
As much for my own reference as for anything: https://github.com/postgres/postgres/blob/master/src/backend/utils/adt/numeric.c#L692
Since these things are arbitrary precision, it seems like maybe the best representation would be {Number, Precision} or something like that. But that's definitely going to change the interface.
Looks like we could certainly return something compatible with that library, and point to it in our documentation. Anyone opposed?
Yes, I think it should be easy to use that format as both input and output without adding the dependency.
I have pushed a branch for this work, called 'numerics'. Decoding seems to work, encoding doesn't, yet.
The code is currently kind of a mess, and I'm a bit unsure of several things. For instance, `{0, 1, -2}` in the erlang-decimal format is more or less equal...
Ok, so looking at my bleary-eyed hacky code is probably a bad idea. That said, this stuff is kind of complex, and I'm not 100% sure of Postgres' behavior in...
@kpy3 I never found an answer I was 100% satisfied with, so haven't done anything for the time being. What problems were you encountering? As for custom converters.... it's probably...
I'd be wary of moving too much stuff that's reasonably common to its own project; it makes it more difficult to get set up. With git, if people want to...