跳到正文
原文
Neon Blog· George MacKerron·· 2023-08-25AI 评分30

在 JS 里解析 Postgres 的 JSON?小心拿到错误的数字

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

AI 导读

在 JavaScript 中解析 Postgres 的 JSON 数据时,大整数会因 JS 的 Number 精度限制而被静默截断,导致取到错误数值。Postgres 自 9.2 起提供原生 JSON 类型,但跨语言传输时需注意精度问题。

来源:Neon Blog · neon.com