hstore
data type for storing sets of (key, value) pairs
hstore · data type for storing sets of (key, value) pairs
Overview
| ID | Extension | Package | Version | Category | License | Language |
|---|---|---|---|---|---|---|
| 3970 | hstore | hstore | 1.8 | TYPE | PostgreSQL | C |
| Attribute | Has Binary | Has Library | Need Load | Has DDL | Relocatable | Trusted |
|---|---|---|---|---|---|---|
| --s-dtr | No | Yes | No | Yes | yes | yes |
Packages
| PG19 | PG18 | PG17 | PG16 | PG15 |
|---|---|---|---|---|
| 1.8 | 1.8 | 1.8 | 1.8 | 1.8 |
This contrib extension ships with PostgreSQL.
Install
Create this extension with:
Usage
The hstore extension provides a key/value pair data type for storing semi-structured data in a single column.
Basic Usage
Operators
| Operator | Description | Example |
|---|---|---|
-> | Get value by key | h -> 'key' |
|| | Concatenate | h1 || h2 |
? | Contains key | h ? 'key' |
?& | Contains all keys | h ?& ARRAY['a','b'] |
?| | Contains any key | h ?| ARRAY['a','b'] |
@> | Contains | h @> 'a=>1' |
<@ | Contained by | h <@ 'a=>1, b=>2' |
- | Delete key(s) | h - 'key' or h - ARRAY['a','b'] |