TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Show HN: BSON Extension for Postgres

115 点作者 buzzm超过 1 年前
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.

8 条评论

ccleve超过 1 年前
The code here is really well designed. This project can serve as a tutorial on how to build a Postgres extension. Have a look at this:<p><a href="https:&#x2F;&#x2F;github.com&#x2F;buzzm&#x2F;postgresbson&#x2F;blob&#x2F;main&#x2F;pgbson--2.0.sql">https:&#x2F;&#x2F;github.com&#x2F;buzzm&#x2F;postgresbson&#x2F;blob&#x2F;main&#x2F;pgbson--2.0....</a><p>and this:<p><a href="https:&#x2F;&#x2F;github.com&#x2F;buzzm&#x2F;postgresbson&#x2F;blob&#x2F;main&#x2F;pgbson.c">https:&#x2F;&#x2F;github.com&#x2F;buzzm&#x2F;postgresbson&#x2F;blob&#x2F;main&#x2F;pgbson.c</a><p>Really nice stuff.
hnto_pics超过 1 年前
That&#x27;s the first time I hear of BSON. How does this compare to cbor and messagepack?
评论 #39020383 未加载
评论 #39018474 未加载
lxe超过 1 年前
Why BSON and not JSONB, which is already supported in Postgres?
评论 #39015108 未加载
评论 #39015112 未加载
评论 #39015099 未加载
eddd-ddde超过 1 年前
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?
vvpan超过 1 年前
Perhaps this is an opportunity to ask somebody who might know about BSON performance. As a POC&#x2F;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.
评论 #39018126 未加载
dsizzle超过 1 年前
Listed status is &quot;experimental&quot; but only two relatively minor commits in the last two years. Maybe it&#x27;s more stable than that implies or the author is looking to pick it back up?
hanszarkov超过 1 年前
I&#x27;ve used the BSON Java ObjectId for distributed primary key generation for a long time. Really useful for distributed systems.
评论 #39032388 未加载
pella超过 1 年前
As I understand it, it was &#x27;Tested using Postgres 14.4&#x27;.<p>I&#x27;m wondering if there are any plans to support Postgres versions 15 and 16?
评论 #39031615 未加载
评论 #39022047 未加载