JSON support in postgres is superb but sometimes you really want decimal, date, and binary types, "carefree" UTF8 string handling (i.e. no escaping), and robust roundtrippability. So I made an extension for BSON.
by ccleve on 1/16/24, 5:05 PM
by hnto_pics on 1/16/24, 2:36 PM
That's the first time I hear of BSON. How does this compare to cbor and messagepack?
by lxe on 1/16/24, 4:14 PM
Why BSON and not JSONB, which is already supported in Postgres?
by eddd-ddde on 1/16/24, 2:43 PM
This is really cool. A common use case for me is building JSON objects directly in my query, for example to return a list of json objects. Usually this means date columns lose their type, is there a way of returning bson like with jsonb_build_object that keeps this types?
by vvpan on 1/16/24, 6:41 PM
Perhaps this is an opportunity to ask somebody who might know about BSON performance. As a POC/stress test for work I added two multi-GB datasets to Postgres (as JSONB) and to Mongo (BSON). While trying to query approximately a hundred megabytes of data (a few hundred documents) from each I found that Postgres executed the query and decoded the JSON data in under a second, while it took Mongo a few seconds.
Does this mean that BSON is slow to deserialize? Or perhaps it is not related to serialization? I was quite confused.
by dsizzle on 1/16/24, 6:58 PM
Listed status is "experimental" but only two relatively minor commits in the last two years. Maybe it's more stable than that implies or the author is looking to pick it back up?
by hanszarkov on 1/16/24, 11:33 PM
I've used the BSON Java ObjectId for distributed primary key generation for a long time. Really useful for distributed systems.
by pella on 1/16/24, 2:53 PM
As I understand it, it was 'Tested using Postgres 14.4'.
I'm wondering if there are any plans to support Postgres versions 15 and 16?