查看Size 數據庫
函數名 | 返回類型 | 描述 |
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'] |