POSTGRESQL 应用
2016-01-20 16:48
447 查看
查看Size
json and jsonb Operators
Additional jsonb Operators
函数名 | 返回类型 | 描述 |
pg_column_size(any) | int | 存储一个指定的数值需要的字节数(可能压缩过) |
pg_database_size(oid) | bigint | 指定OID的数据库使用的磁盘空间 |
pg_database_size(name) | bigint | 指定名称的数据库使用的磁盘空间 |
pg_indexes_size(regclass) | bigint | 关联指定表OID或表名的表索引的使用总磁盘空间 |
pg_relation_size(relation regclass, fork text) | bigint | 指定OID或名的表或索引,通过指定fork('main', 'fsm' 或'vm')所使用的磁盘空间 |
pg_relation_size(relation regclass) | bigint | pg_relation_size(..., 'main')的缩写 |
pg_size_pretty(bigint) | text | Converts a size in bytes expressed as a 64-bit integer into a human-readable format with size units |
pg_size_pretty(numeric) | text | 把以字节计算的数值转换成一个人类易读的尺寸单位 |
pg_table_size(regclass) | bigint | 指定表OID或表名的表使用的磁盘空间,除去索引(但是包含TOAST,自由空间映射和可视映射) |
pg_tablespace_size(oid) | bigint | 指定OID的表空间使用的磁盘空间 |
pg_tablespace_size(name) | bigint | 指定名称的表空间使用的磁盘空间 |
pg_total_relation_size(regclass) | bigint | 指定表OID或表名使用的总磁盘空间,包括所有索引和TOAST数据 |
Operator | Right Operand Type | Description | Example | Example Result |
---|---|---|---|---|
-> | int | Get JSON array element (indexed from zero) | '[{"a":"foo"},{"b":"bar"},{"c":"baz"}]'::json->2 | {"c":"baz"} |
-> | text | Get JSON object field by key | '{"a": {"b":"foo"}}'::json->'a' | {"b":"foo"} |
->> | int | Get JSON array element as text | '[1,2,3]'::json->>2 | 3 |
->> | text | Get JSON object field as text | '{"a":1,"b":2}'::json->>'b' | 2 |
#> | text[] | Get JSON object at specified path | '{"a": {"b":{"c": "foo"}}}'::json#>'{a,b}' | {"c": "foo"} |
#>> | text[] | Get JSON object at specified path as text | '{"a":[1,2,3],"b":[4,5,6]}'::json#>>'{a,2}' | 3 |
Operator | Right Operand Type | Description | Example |
---|---|---|---|
= | jsonb | Are the two JSON values equal? | '[1,2,3]'::jsonb = '[1,2,3]'::jsonb |
@> | jsonb | Does the left JSON value contain within it the right value? | '{"a":1, "b":2}'::jsonb @> '{"b":2}'::jsonb |
<@ | jsonb | Is the left JSON value contained within the right value? | '{"b":2}'::jsonb <@ '{"a":1, "b":2}'::jsonb |
? | text | Does the key/element string exist within the JSON value? | '{"a":1, "b":2}'::jsonb ? 'b' |
?| | text[] | Do any of these key/element strings exist? | '{"a":1, "b":2, "c":3}'::jsonb ?| array['b', 'c'] |
?& | text[] | Do all of these key/element strings exist? | '["a", "b"]'::jsonb ?& array['a', 'b'] |
相关文章推荐
- 连接SQL*Plus Worksheet
- 出错场景是升级oracle驱动,将版本从ojdbc14升级到ojdbc6,hibernate执行原生态sql语句会报如下错误
- Postgresql安装后,只能本地连接
- 关于hibernate纯sql查询返回结果集的问题(hbm.xml中不写多表关联)
- Oracle数据库基础知识
- MySql的基本架构演变
- mybatis的分页操作
- MYSQL正则表达式
- hive1.1.0安装与配置(远程mysql)
- MySQL5.6 实现主从复制,读写分离,分散单台服务器压力
- 修改mysql最大连接次数问题,默认为100次
- 数据库事务的隔离级别
- Mysql连接不上数据库问题
- linux服务器查看redis版本:
- MySQL数据库多实例主从同步
- MySQL主键的理解
- oracle中如何将字符和数字转成中文
- oracle查看数据库版本和字符集
- mysql数据转到oracle数据库
- mysql explain 详解