Skip to content

PostgreSQL numeric type supports larger numbers than .NET decimal #448

@Emill

Description

@Emill

The numeric type in PostgreSQL supports almost arbitrary large numbers.
The .NET decimal type, however, is just 128 bits.
We currently map these two types together, but we should somehow support larger numbers as well.
Today an OverflowException is simply thrown when such a value is read.

The problem is, should reader.GetValue() return different types depending on how large the number is?
Or should we return a decimal if there is a field description and the field type has a precision/scale that fits into a decimal, and otherwise some other data type that supports arbitrary-length values? A problem is then that if you run select numeric_field + 1 the precision/scale attributes are dropped.
Also, what data type should be used for such numbers?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions