hillpig的个人博客分享 http://blog.sciencenet.cn/u/hillpig 畅想ing,思考ing,前行ing Email:bluevaley@gmail.com

博文

PG历代版本对JSON的支持情况(PG JSON系列7)

已有 3557 次阅读 2016-10-25 15:12 |个人分类:postgresql|系统分类:科研笔记| postgresql, jsonb

前6篇博文,分别写了使用PG的JSONB类型的几个方面:

  1. 使用PostgreSQL中的row_to_json()直接获得JSON(PG JSON系列1)

  2. JSON/JSONB如何做增删改查(PG JSON系列2)

  3. 组合使用PostgreSQL的ARRAY和JSONB数据类型(PG JSON系列3)

  4. PG中验证JSON Schema(PG JSON系列4)

  5. PG中JSONB存储和访问效率(PG JSON系列5)

  6. Node.js如何方便的使用PostgreSQL中的JSONB数据(PG JSON系列6)

这一篇写写PG历代版本对JSON的支持情况(红色表示新增),见下表:

version

Data  Type

Operators  

Functions

Aggregate Functions

Indexing

9.2.18

json


array_to_json

row_to_json

9.3.14

json

->

->>

#>

#>>

array_to_json

row_to_json

to_json

json_array_length

json_each

json_each_text

json_extract_path

json_extract_path_text

json_object_keys

json_populate_record

json_populate_recordset

json_array_elements

json_agg

9.4.9

json

jsonb

jsonb Operators:

1.          @>

2.          <@

3.          ?

4.          ?|

5.          ?&

JSON Creation Functions:

1.          array_to_json

2.          json_build_array

3.          json_build_object

4.          json_object

Processing Functions:

5.          json_array_elements_text

6.          jsonb_array_elements_text

7.          json_typeof

8.          jsonb_typeof

9.          json_to_record

10.      jsonb_to_record

11.      json_to_recordset

12.      jsonb_to_recordset

json_object_agg

Support

9.5.4

json

jsonb

jsonb Operators:

1.          ||

2.          -

3.          #-

JSON Creation Functions:

1.          to_jsonb

2.          jsonb_build_array

3.          jsonb_build_object

4.          jsonb_object

Processing Functions:

5.          json_strip_nulls

6.          jsonb_strip_nulls

7.          jsonb_set

8.          jsonb_pretty

jsonb_agg

jsonb_object_agg

Support

9.6.0

json

jsonb

无变化

JSON Creation Functions:无变化

Processing Functions:

1.          jsonb_insert

无变化

Support

上表也可以通过这里 http://pan.baidu.com/s/1c1VU1YK  得到。

结论:基本上从9.5开始,才比较好用。


码字码了半天,手指头都麻了,如果觉得对您还有用的话,赞助一下辛苦费吧:






https://blog.sciencenet.cn/blog-419883-1010771.html

上一篇:When to use jsonb in postgresql?
下一篇:为什么我们需要全栈工程师(全栈工程师系列1)
收藏 IP: 61.135.169.*| 热度|

0

该博文允许注册用户评论 请点击登录 评论 (0 个评论)

数据加载中...

Archiver|手机版|科学网 ( 京ICP备07017567号-12 )

GMT+8, 2024-4-25 20:23

Powered by ScienceNet.cn

Copyright © 2007- 中国科学报社

返回顶部