# Parsing JSON from Postgres in JS? Don't get the wrong number

DevFeed: [Parsing JSON from Postgres in JS? Don't get the wrong number](<https://devfeed.tech/articles/parsing-json-from-postgres-in-js-don-t-get-the-wrong-number-5709.md>)

Original publisher: [Read original article](<https://neon.com/blog/parsing-json-from-postgres-in-js>)

Author: George MacKerron

Published: 2023-08-24T16:24:56Z

Content type: article

Language: en

Sources: [Blog -- Neon Docs](<https://devfeed.tech/sources/blog-neon-docs.md>)

Topics: [JSON](<https://devfeed.tech/topics/json.md>), [Databases](<https://devfeed.tech/topics/databases.md>), [JavaScript](<https://devfeed.tech/topics/javascript.md>), [interoperability](<https://devfeed.tech/topics/interoperability.md>), [TypeScript](<https://devfeed.tech/topics/typescript.md>), [Code](<https://devfeed.tech/topics/code.md>)

Tags: [code](<https://devfeed.tech/tags/code.md>), [database](<https://devfeed.tech/tags/database.md>), [engineering](<https://devfeed.tech/tags/engineering.md>), [javascript](<https://devfeed.tech/tags/javascript.md>), [json](<https://devfeed.tech/tags/json.md>), [postgres](<https://devfeed.tech/tags/postgres.md>), [typescript](<https://devfeed.tech/tags/typescript.md>)

## AI overview

The article explains how large or highly precise numeric values in Postgres JSON can be changed silently when parsed by JavaScript, whose number type uses IEEE 754 representation. It describes using a custom JSON parser with Postgres drivers such as node-postgres and @neondatabase/serverless to preserve these values.

## Source excerpt

Back in 2010, my first production Postgres database used a couple of JSON columns to provide some flexibility around the main schema. From the point of view of the database, those columns were actually just text. But Postgres got a native JSON type soon after (with version 9.2 in...