jackc / pgtype

MIT License
300 stars 111 forks source link

DecodeBinary can't decode NaN #199

Closed ghstahl closed 1 year ago

ghstahl commented 1 year ago

https://github.com/jackc/pgtype/issues/198

jackc commented 1 year ago

pgtype.Numeric supports NaN and infinity. It's the shopspring/decimal package that doesn't. I don't think adding new pgtype.Status values is a good idea. If something was to be changed with the integration is would make more sense to add NaN bool and InfinityModifier InfinityModifier like pgtype.Numeric have.

I don't really see making any changes to the standard shopspring/decimal integration, but it should be easy to copy the extension package to your own project and make these changes if there is no other way.