Comment 2 for bug 2018534

Revision history for this message
Mike Rylander (mrylander) wrote :

Jeff,

Thanks, that looks like a perfectly wonderful fix for the issue. I'll commit this unless someone beats me to it.

For future-us, the background/root-cause of this is that Postgres's NUMERIC type is only limited by the general field size limitations of the backend (generally 1GB worth of ASCII characters), whereas other number-ish types (INT, BIGINT, etc) have upper and lower limits that allow us to map them to normal number-like types in the languages EG is implemented in. So, for NUMERIC, we map to the language-native string type to avoid rounding, overflow, or the like.

In this particular case, an alternate solution would be to cast the column's type to, say, INT, and then it would be number-ish in the intermediate JSON. It wouldn't be crazy to do that in addition to Jeff's fix, also, since we know the range of reasonable values for this column/field.