jsquery
data type for jsonb inspection
jsquery · data type for jsonb inspection
Overview
| ID | Extension | Package | Version | Category | License | Language |
|---|---|---|---|---|---|---|
| 2770 | jsquery | jsquery | 1.2 | FEAT | PostgreSQL | C |
| Attribute | Has Binary | Has Library | Need Load | Has DDL | Relocatable | Trusted |
|---|---|---|---|---|---|---|
| --s-d-r | No | Yes | No | Yes | yes | no |
| Relationships | |
|---|---|
| See Also | pgbson pgjq pg_jsonschema jsonschema pg_projection documentdb mongo_fdw jsonb_plperl jsonb_plpython3u jsonb_plperlu |
Packages
| Linux / PG | PG19 | PG18 | PG17 | PG16 | PG15 |
|---|---|---|---|---|---|
| el8.x86_64 | N/A | PGDG 1.2 | PGDG 1.2 | PGDG 1.2 | PGDG 1.2 |
| el8.aarch64 | N/A | PGDG 1.2 | PGDG 1.2 | PGDG 1.2 | PGDG 1.2 |
| el9.x86_64 | MISS | PGDG 1.2 | PGDG 1.2 | PGDG 1.2 | PGDG 1.2 |
| el9.aarch64 | MISS | PGDG 1.2 | PGDG 1.2 | PGDG 1.2 | PGDG 1.2 |
| el10.x86_64 | MISS | PGDG 1.2 | PGDG 1.2 | PGDG 1.2 | PGDG 1.2 |
| el10.aarch64 | MISS | PGDG 1.2 | PGDG 1.2 | PGDG 1.2 | PGDG 1.2 |
| d12.x86_64 | PGDG 1.2 | PGDG 1.2 | PGDG 1.2 | PGDG 1.2 | PGDG 1.2 |
| d12.aarch64 | PGDG 1.2 | PGDG 1.2 | PGDG 1.2 | PGDG 1.2 | PGDG 1.2 |
| d13.x86_64 | PGDG 1.2 | PGDG 1.2 | PGDG 1.2 | PGDG 1.2 | PGDG 1.2 |
| d13.aarch64 | PGDG 1.2 | PGDG 1.2 | PGDG 1.2 | PGDG 1.2 | PGDG 1.2 |
| u22.x86_64 | PGDG 1.2 | PGDG 1.2 | PGDG 1.2 | PGDG 1.2 | PGDG 1.2 |
| u22.aarch64 | PGDG 1.2 | PGDG 1.2 | PGDG 1.2 | PGDG 1.2 | PGDG 1.2 |
| u24.x86_64 | PGDG 1.2 | PGDG 1.2 | PGDG 1.2 | PGDG 1.2 | PGDG 1.2 |
| u24.aarch64 | PGDG 1.2 | PGDG 1.2 | PGDG 1.2 | PGDG 1.2 | PGDG 1.2 |
| u26.x86_64 | PGDG 1.2 | PGDG 1.2 | PGDG 1.2 | PGDG 1.2 | PGDG 1.2 |
| u26.aarch64 | PGDG 1.2 | PGDG 1.2 | PGDG 1.2 | PGDG 1.2 | PGDG 1.2 |
| Package | Version | OS | ORG | SIZE | File URL |
|---|---|---|---|---|---|
postgresql-19-jsquery | 1.2 | d12.x86_64 | pgdg | 118.5 KiB | postgresql-19-jsquery_1.2-4.pgdg12+1_amd64.deb |
postgresql-19-jsquery | 1.2 | d12.aarch64 | pgdg | 115.4 KiB | postgresql-19-jsquery_1.2-4.pgdg12+1_arm64.deb |
postgresql-19-jsquery | 1.2 | d13.x86_64 | pgdg | 118.7 KiB | postgresql-19-jsquery_1.2-4.pgdg13+1_amd64.deb |
postgresql-19-jsquery | 1.2 | d13.aarch64 | pgdg | 115.7 KiB | postgresql-19-jsquery_1.2-4.pgdg13+1_arm64.deb |
postgresql-19-jsquery | 1.2 | u22.x86_64 | pgdg | 118.9 KiB | postgresql-19-jsquery_1.2-4.pgdg22.04+1_amd64.deb |
postgresql-19-jsquery | 1.2 | u22.aarch64 | pgdg | 115.8 KiB | postgresql-19-jsquery_1.2-4.pgdg22.04+1_arm64.deb |
postgresql-19-jsquery | 1.2 | u24.x86_64 | pgdg | 117.8 KiB | postgresql-19-jsquery_1.2-4.pgdg24.04+1_amd64.deb |
postgresql-19-jsquery | 1.2 | u24.aarch64 | pgdg | 115.0 KiB | postgresql-19-jsquery_1.2-4.pgdg24.04+1_arm64.deb |
postgresql-19-jsquery | 1.2 | u26.x86_64 | pgdg | 116.4 KiB | postgresql-19-jsquery_1.2-4.pgdg26.04+1_amd64.deb |
postgresql-19-jsquery | 1.2 | u26.aarch64 | pgdg | 113.4 KiB | postgresql-19-jsquery_1.2-4.pgdg26.04+1_arm64.deb |
Source
github.com/postgrespro/jsquery
Install
Make sure PGDG repo available:
Install this extension with pig:
Create this extension with:
Usage
JsQuery provides a query language for JSONB data, similar to what tsquery does for full-text search. It offers a concise way to search nested objects and arrays with index support via GIN.
Operators
| Operator | Description |
|---|---|
@@ | Match operator: test whether a jsonb value matches a jsquery expression |
Query Syntax
Expressions follow the pattern path operator value:
Binary operators:
=(equality),>,>=,<,<=(comparison)IN(list membership)&&(overlap),@>(contains),<@(contained in)
Unary operators:
= *(existence check)IS ARRAY,IS NUMERIC,IS OBJECT,IS STRING,IS BOOLEAN(type checking)
Path Expressions
| Symbol | Meaning |
|---|---|
# | Any array index |
#N | Specific array index N |
% | Any object key |
* | Any sequence of keys/indexes |
@# | Array/object length |
$ | Entire document |
“Every” semantics (all elements must match):
#:– all array elements%:– all object keys*:– all nested paths
Examples
Simple value matching:
Logical combinations:
Array element matching (find array elements where both conditions hold):
Object key range matching:
GIN Indexing
Two operator classes for different query patterns:
Optimizer hints for index usage: