Closed budarin closed 4 years ago
Took me a second to notice that you're calling json_build_object
. Note that the field data type ID is jsonb:
JSON does not specify size limits on numbers so you risk losing data during JSON.parse
. If you change your query to select '9223372036854775807'::BIGINT
you'll get a BigInt
result.
Some info on this:
https://golb.hplar.ch/2019/01/js-bigint-json.html https://itnext.io/lets-talk-about-big-numbers-in-javascript-b0a2c8edb170
There's obviously a lot of backwards compatibility concerns in adding BigInt
support to the JSON
methods so if you really do need to parse JSON with bigints included in JS you may have trouble finding good libraries.
@bendrucker thanks!
What I do
The query:
then run code and have a such output
what I can see
My parser is not set and bigint value converted to int Something went wrong :(