parray_gin
parray_gin : GIN index operator class and partial-match operators for text arrays
Overview
| ID | Extension | Package | Version | Category | License | Language |
|---|---|---|---|---|---|---|
| 4860 | parray_gin
|
parray_gin
|
1.5.0 |
FUNC
|
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 | intarray
btree_gin
btree_gist
pg_trgm
smlar
aggs_for_arrays
aggs_for_vecs
arraymath
|
PGXN dist name and PostgreSQL extension name are both parray_gin; Pigsty packages are built for PG 14-18.
Packages
| Type | Repo | Version | PG Major Compatibility | Package Pattern | Dependencies |
|---|---|---|---|---|---|
| EXT | PIGSTY
|
1.5.0 |
18
17
16
15
14
|
parray_gin |
- |
| RPM | PIGSTY
|
1.5.0 |
18
17
16
15
14
|
parray_gin_$v |
- |
| DEB | PIGSTY
|
1.5.0 |
18
17
16
15
14
|
postgresql-$v-parray-gin |
- |
| Linux / PG | PG18 | PG17 | PG16 | PG15 | PG14 |
|---|---|---|---|---|---|
el8.x86_64
|
PIGSTY 1.5.0
|
PIGSTY 1.5.0
|
PIGSTY 1.5.0
|
PIGSTY 1.5.0
|
PIGSTY 1.5.0
|
el8.aarch64
|
PIGSTY 1.5.0
|
PIGSTY 1.5.0
|
PIGSTY 1.5.0
|
PIGSTY 1.5.0
|
PIGSTY 1.5.0
|
el9.x86_64
|
PIGSTY 1.5.0
|
PIGSTY 1.5.0
|
PIGSTY 1.5.0
|
PIGSTY 1.5.0
|
PIGSTY 1.5.0
|
el9.aarch64
|
PIGSTY 1.5.0
|
PIGSTY 1.5.0
|
PIGSTY 1.5.0
|
PIGSTY 1.5.0
|
PIGSTY 1.5.0
|
el10.x86_64
|
PIGSTY 1.5.0
|
PIGSTY 1.5.0
|
PIGSTY 1.5.0
|
PIGSTY 1.5.0
|
PIGSTY 1.5.0
|
el10.aarch64
|
PIGSTY 1.5.0
|
PIGSTY 1.5.0
|
PIGSTY 1.5.0
|
PIGSTY 1.5.0
|
PIGSTY 1.5.0
|
d12.x86_64
|
PIGSTY 1.5.0
|
PIGSTY 1.5.0
|
PIGSTY 1.5.0
|
PIGSTY 1.5.0
|
PIGSTY 1.5.0
|
d12.aarch64
|
PIGSTY 1.5.0
|
PIGSTY 1.5.0
|
PIGSTY 1.5.0
|
PIGSTY 1.5.0
|
PIGSTY 1.5.0
|
d13.x86_64
|
PIGSTY 1.5.0
|
PIGSTY 1.5.0
|
PIGSTY 1.5.0
|
PIGSTY 1.5.0
|
PIGSTY 1.5.0
|
d13.aarch64
|
PIGSTY 1.5.0
|
PIGSTY 1.5.0
|
PIGSTY 1.5.0
|
PIGSTY 1.5.0
|
PIGSTY 1.5.0
|
u22.x86_64
|
PIGSTY 1.5.0
|
PIGSTY 1.5.0
|
PIGSTY 1.5.0
|
PIGSTY 1.5.0
|
PIGSTY 1.5.0
|
u22.aarch64
|
PIGSTY 1.5.0
|
PIGSTY 1.5.0
|
PIGSTY 1.5.0
|
PIGSTY 1.5.0
|
PIGSTY 1.5.0
|
u24.x86_64
|
PIGSTY 1.5.0
|
PIGSTY 1.5.0
|
PIGSTY 1.5.0
|
PIGSTY 1.5.0
|
PIGSTY 1.5.0
|
u24.aarch64
|
PIGSTY 1.5.0
|
PIGSTY 1.5.0
|
PIGSTY 1.5.0
|
PIGSTY 1.5.0
|
PIGSTY 1.5.0
|
u26.x86_64
|
PIGSTY 1.5.0
|
PIGSTY 1.5.0
|
PIGSTY 1.5.0
|
PIGSTY 1.5.0
|
PIGSTY 1.5.0
|
u26.aarch64
|
PIGSTY 1.5.0
|
PIGSTY 1.5.0
|
PIGSTY 1.5.0
|
PIGSTY 1.5.0
|
PIGSTY 1.5.0
|
Source
pig build pkg parray_gin; # build rpm/debInstall
Make sure PGDG and PIGSTY repo available:
pig repo add pgsql -u # add both repo and update cacheInstall this extension with pig:
pig install parray_gin; # install via package name, for the active PG version
pig install parray_gin -v 18; # install for PG 18
pig install parray_gin -v 17; # install for PG 17
pig install parray_gin -v 16; # install for PG 16
pig install parray_gin -v 15; # install for PG 15
pig install parray_gin -v 14; # install for PG 14Create this extension with:
CREATE EXTENSION parray_gin;Usage
- Sources: README, reference doc
parray_gin adds a GIN operator class for text[] plus strict and partial-match operators. Upstream describes it as trigram-based array indexing built on pg_trgm trigram decomposition.
Create The Extension And Index
CREATE EXTENSION parray_gin;
CREATE TABLE test_table (
id bigserial,
val text[]
);
CREATE INDEX test_tags_idx
ON test_table
USING gin (val parray_gin_ops);Indexed Operators
The reference doc says parray_gin_ops can support these operators:
@>: strict contains.<@: strict contained-by.@@>: partial contains, where array elements may useLIKEpatterns.<@@: partial contained-by.
Examples:
SELECT * FROM test_table WHERE val @> ARRAY['must','contain'];
SELECT * FROM test_table WHERE val @@> ARRAY['what%like%'];
SELECT * FROM test_table WHERE val <@ ARRAY['galaxy','ago','vader'];
SELECT * FROM test_table WHERE val <@@ ARRAY['%ar%','vader'];Matching Behavior
Strict matching requires array-item equality. Partial matching allows patterns such as 'foo%' or '%oo%'. Because the trigram index can return false positives, the docs note that matches are rechecked after index lookup.
Caveats
The README says support extends through PostgreSQL 18, while the reference document still says 9.1-14. The operator and opclass behavior is consistent across both docs, but the version note is not fully synchronized upstream.