hstore
用于存储(键,值)对集合的数据类型
概览
| 扩展包名 | 版本 | 分类 | 许可证 | 语言 |
|---|---|---|---|---|
hstore | 1.8 | TYPE | PostgreSQL | C |
| ID | 扩展名 | Bin | Lib | Load | Create | Trust | Reloc | 模式 |
|---|---|---|---|---|---|---|---|---|
| 3970 | hstore | 否 | 是 | 否 | 是 | 是 | 否 | - |
| 相关扩展 | pgbson collection jsonschema pgjq jsquery pg_jsonschema intarray arraymath pgpdf pglite_fusion |
|---|---|
| 下游依赖 | flux format hstore_hash_ops hstore_ops hstore_pllua hstore_plluau hstore_plperl hstore_plperlu hstore_plpython2u hstore_plpython3u hstore_plpythonu hstore_plruby json_enhancements_with_hstore mbus meta_triggers numhstore pg_auditor pg_readme pg_rowalesce pg_utility_trigger_functions pg_xenophile sys_syn_dblink |
版本
| PG18 | PG17 | PG16 | PG15 | PG14 |
|---|---|---|---|---|
| 1.8 | 1.8 | 1.8 | 1.8 | 1.8 |
安装
提示:这是 PostgreSQL 内核自带的 contrib 扩展
SQL
用法
hstore 扩展提供了一种键/值对数据类型,用于在单个列中存储半结构化数据。
SQL
基本用法
SQL
运算符
| 运算符 | 描述 | 示例 |
|---|---|---|
-> | 按键获取值 | h -> 'key' |
|| | 连接 | h1 || h2 |
? | 包含键 | h ? 'key' |
?& | 包含所有键 | h ?& ARRAY['a','b'] |
?| | 包含任一键 | h ?| ARRAY['a','b'] |
@> | 包含 | h @> 'a=>1' |
<@ | 被包含 | h <@ 'a=>1, b=>2' |
- | 删除键 | h - 'key' 或 h - ARRAY['a','b'] |
下标访问
SQL
函数
SQL
索引支持
SQL