postgresql - Postgres jsonb_object_keys limiting result set
问题描述
Can someone explain to me why jsonb_object_keys
can limit my result set?
I would expect the following to return 2 rows:
1,3
2,null
But the last one is filtered out.
SELECT
idx,
jsonb_object_keys(json_data::jsonb -> '2')
FROM
(
SELECT 1 as idx, '{"1":"val","2":{"3": "val"}}' as json_data
UNION ALL
SELECT 2 as idx, '{"1":"val"}' as json_data
) a
Version: PostgreSQL 11.6 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-11), 64-bit
解决方案
推荐阅读
- java - 来自远程 JSON 的 GSON
- html - BeautifulSoup 和 prettify() 函数
- firebase - Flutter 中社交新闻源的 Cloud FireStore 架构
- python - Python:比较和计算数千个字典/XML/JSON 中的字典结构
- java - 如何解决名称冲突有相同的擦除?
- php - 如何替换 HTML 内容中的所有新行但在 textarea 中保留新行?
- r - 计算r中相交平面上一条线与所有点之间的距离
- node.js - 如何在包中获取后端的基本 uri?
- c# - 是否可以让 biztalk 2013 写入天蓝色队列?
- reactjs - 如何在播放 mp4 文件时修改 React Player 的控件。我希望禁用下载选项