Skip to content

ActiveRecord::RangeError: PG::NumericValueOutOfRange: ERROR: value overflows numeric format #69

@marcgreenstock

Description

@marcgreenstock

I'm having a problem with any string that appears to be in scientific notation. For instance '557236406134e62000323100'.

The specific error is:

ActiveRecord::RangeError: PG::NumericValueOutOfRange: ERROR:  value overflows numeric format
CONTEXT:  PL/pgSQL function logidze_logger() line 68 at assignment

Postgres version: 9.6

Edit: I have my suspicions that it is because of the to_jsonb method.

Returns the value as json or jsonb. Arrays and composites are converted (recursively) to arrays and objects; otherwise, if there is a cast from the type to json, the cast function will be used to perform the conversion; otherwise, a scalar value is produced. For any scalar type other than a number, a Boolean, or a null value, the text representation will be used, in such a fashion that it is a valid json or jsonb value.

I believe to_jsonb is erroneously attempting to typecast the string, could this be a bug in PG?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions