跳转到主要内容

parray_gin

GIN index operator class and partial-match operators for text arrays

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
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
Package Version OS ORG SIZE File URL
parray_gin_18 1.5.0 el8.x86_64 pigsty 23.8 KiB parray_gin_18-1.5.0-1PIGSTY.el8.x86_64.rpm
parray_gin_18 1.5.0 el8.aarch64 pigsty 23.5 KiB parray_gin_18-1.5.0-1PIGSTY.el8.aarch64.rpm
parray_gin_18 1.5.0 el9.x86_64 pigsty 23.0 KiB parray_gin_18-1.5.0-1PIGSTY.el9.x86_64.rpm
parray_gin_18 1.5.0 el9.aarch64 pigsty 22.9 KiB parray_gin_18-1.5.0-1PIGSTY.el9.aarch64.rpm
parray_gin_18 1.5.0 el10.x86_64 pigsty 23.4 KiB parray_gin_18-1.5.0-1PIGSTY.el10.x86_64.rpm
parray_gin_18 1.5.0 el10.aarch64 pigsty 23.2 KiB parray_gin_18-1.5.0-1PIGSTY.el10.aarch64.rpm
postgresql-18-parray-gin 1.5.0 d12.x86_64 pigsty 30.2 KiB postgresql-18-parray-gin_1.5.0-1PIGSTY~bookworm_amd64.deb
postgresql-18-parray-gin 1.5.0 d12.aarch64 pigsty 30.0 KiB postgresql-18-parray-gin_1.5.0-1PIGSTY~bookworm_arm64.deb
postgresql-18-parray-gin 1.5.0 d13.x86_64 pigsty 30.3 KiB postgresql-18-parray-gin_1.5.0-1PIGSTY~trixie_amd64.deb
postgresql-18-parray-gin 1.5.0 d13.aarch64 pigsty 30.3 KiB postgresql-18-parray-gin_1.5.0-1PIGSTY~trixie_arm64.deb
postgresql-18-parray-gin 1.5.0 u22.x86_64 pigsty 31.5 KiB postgresql-18-parray-gin_1.5.0-1PIGSTY~jammy_amd64.deb
postgresql-18-parray-gin 1.5.0 u22.aarch64 pigsty 31.0 KiB postgresql-18-parray-gin_1.5.0-1PIGSTY~jammy_arm64.deb
postgresql-18-parray-gin 1.5.0 u24.x86_64 pigsty 31.1 KiB postgresql-18-parray-gin_1.5.0-1PIGSTY~noble_amd64.deb
postgresql-18-parray-gin 1.5.0 u24.aarch64 pigsty 31.4 KiB postgresql-18-parray-gin_1.5.0-1PIGSTY~noble_arm64.deb
postgresql-18-parray-gin 1.5.0 u26.x86_64 pigsty 30.9 KiB postgresql-18-parray-gin_1.5.0-1PIGSTY~resolute_amd64.deb
postgresql-18-parray-gin 1.5.0 u26.aarch64 pigsty 30.9 KiB postgresql-18-parray-gin_1.5.0-1PIGSTY~resolute_arm64.deb
Package Version OS ORG SIZE File URL
parray_gin_17 1.5.0 el8.x86_64 pigsty 23.8 KiB parray_gin_17-1.5.0-1PIGSTY.el8.x86_64.rpm
parray_gin_17 1.5.0 el8.aarch64 pigsty 23.6 KiB parray_gin_17-1.5.0-1PIGSTY.el8.aarch64.rpm
parray_gin_17 1.5.0 el9.x86_64 pigsty 23.0 KiB parray_gin_17-1.5.0-1PIGSTY.el9.x86_64.rpm
parray_gin_17 1.5.0 el9.aarch64 pigsty 22.9 KiB parray_gin_17-1.5.0-1PIGSTY.el9.aarch64.rpm
parray_gin_17 1.5.0 el10.x86_64 pigsty 23.4 KiB parray_gin_17-1.5.0-1PIGSTY.el10.x86_64.rpm
parray_gin_17 1.5.0 el10.aarch64 pigsty 23.2 KiB parray_gin_17-1.5.0-1PIGSTY.el10.aarch64.rpm
postgresql-17-parray-gin 1.5.0 d12.x86_64 pigsty 30.3 KiB postgresql-17-parray-gin_1.5.0-1PIGSTY~bookworm_amd64.deb
postgresql-17-parray-gin 1.5.0 d12.aarch64 pigsty 30.2 KiB postgresql-17-parray-gin_1.5.0-1PIGSTY~bookworm_arm64.deb
postgresql-17-parray-gin 1.5.0 d13.x86_64 pigsty 30.4 KiB postgresql-17-parray-gin_1.5.0-1PIGSTY~trixie_amd64.deb
postgresql-17-parray-gin 1.5.0 d13.aarch64 pigsty 30.4 KiB postgresql-17-parray-gin_1.5.0-1PIGSTY~trixie_arm64.deb
postgresql-17-parray-gin 1.5.0 u22.x86_64 pigsty 32.8 KiB postgresql-17-parray-gin_1.5.0-1PIGSTY~jammy_amd64.deb
postgresql-17-parray-gin 1.5.0 u22.aarch64 pigsty 32.3 KiB postgresql-17-parray-gin_1.5.0-1PIGSTY~jammy_arm64.deb
postgresql-17-parray-gin 1.5.0 u24.x86_64 pigsty 31.2 KiB postgresql-17-parray-gin_1.5.0-1PIGSTY~noble_amd64.deb
postgresql-17-parray-gin 1.5.0 u24.aarch64 pigsty 31.5 KiB postgresql-17-parray-gin_1.5.0-1PIGSTY~noble_arm64.deb
postgresql-17-parray-gin 1.5.0 u26.x86_64 pigsty 31.0 KiB postgresql-17-parray-gin_1.5.0-1PIGSTY~resolute_amd64.deb
postgresql-17-parray-gin 1.5.0 u26.aarch64 pigsty 31.0 KiB postgresql-17-parray-gin_1.5.0-1PIGSTY~resolute_arm64.deb
Package Version OS ORG SIZE File URL
parray_gin_16 1.5.0 el8.x86_64 pigsty 23.8 KiB parray_gin_16-1.5.0-1PIGSTY.el8.x86_64.rpm
parray_gin_16 1.5.0 el8.aarch64 pigsty 23.6 KiB parray_gin_16-1.5.0-1PIGSTY.el8.aarch64.rpm
parray_gin_16 1.5.0 el9.x86_64 pigsty 23.1 KiB parray_gin_16-1.5.0-1PIGSTY.el9.x86_64.rpm
parray_gin_16 1.5.0 el9.aarch64 pigsty 22.9 KiB parray_gin_16-1.5.0-1PIGSTY.el9.aarch64.rpm
parray_gin_16 1.5.0 el10.x86_64 pigsty 23.2 KiB parray_gin_16-1.5.0-1PIGSTY.el10.x86_64.rpm
parray_gin_16 1.5.0 el10.aarch64 pigsty 23.2 KiB parray_gin_16-1.5.0-1PIGSTY.el10.aarch64.rpm
postgresql-16-parray-gin 1.5.0 d12.x86_64 pigsty 30.3 KiB postgresql-16-parray-gin_1.5.0-1PIGSTY~bookworm_amd64.deb
postgresql-16-parray-gin 1.5.0 d12.aarch64 pigsty 30.1 KiB postgresql-16-parray-gin_1.5.0-1PIGSTY~bookworm_arm64.deb
postgresql-16-parray-gin 1.5.0 d13.x86_64 pigsty 30.4 KiB postgresql-16-parray-gin_1.5.0-1PIGSTY~trixie_amd64.deb
postgresql-16-parray-gin 1.5.0 d13.aarch64 pigsty 30.4 KiB postgresql-16-parray-gin_1.5.0-1PIGSTY~trixie_arm64.deb
postgresql-16-parray-gin 1.5.0 u22.x86_64 pigsty 32.8 KiB postgresql-16-parray-gin_1.5.0-1PIGSTY~jammy_amd64.deb
postgresql-16-parray-gin 1.5.0 u22.aarch64 pigsty 32.3 KiB postgresql-16-parray-gin_1.5.0-1PIGSTY~jammy_arm64.deb
postgresql-16-parray-gin 1.5.0 u24.x86_64 pigsty 31.2 KiB postgresql-16-parray-gin_1.5.0-1PIGSTY~noble_amd64.deb
postgresql-16-parray-gin 1.5.0 u24.aarch64 pigsty 31.5 KiB postgresql-16-parray-gin_1.5.0-1PIGSTY~noble_arm64.deb
postgresql-16-parray-gin 1.5.0 u26.x86_64 pigsty 31.0 KiB postgresql-16-parray-gin_1.5.0-1PIGSTY~resolute_amd64.deb
postgresql-16-parray-gin 1.5.0 u26.aarch64 pigsty 31.0 KiB postgresql-16-parray-gin_1.5.0-1PIGSTY~resolute_arm64.deb
Package Version OS ORG SIZE File URL
parray_gin_15 1.5.0 el8.x86_64 pigsty 23.8 KiB parray_gin_15-1.5.0-1PIGSTY.el8.x86_64.rpm
parray_gin_15 1.5.0 el8.aarch64 pigsty 23.6 KiB parray_gin_15-1.5.0-1PIGSTY.el8.aarch64.rpm
parray_gin_15 1.5.0 el9.x86_64 pigsty 23.8 KiB parray_gin_15-1.5.0-1PIGSTY.el9.x86_64.rpm
parray_gin_15 1.5.0 el9.aarch64 pigsty 23.3 KiB parray_gin_15-1.5.0-1PIGSTY.el9.aarch64.rpm
parray_gin_15 1.5.0 el10.x86_64 pigsty 24.0 KiB parray_gin_15-1.5.0-1PIGSTY.el10.x86_64.rpm
parray_gin_15 1.5.0 el10.aarch64 pigsty 23.7 KiB parray_gin_15-1.5.0-1PIGSTY.el10.aarch64.rpm
postgresql-15-parray-gin 1.5.0 d12.x86_64 pigsty 30.2 KiB postgresql-15-parray-gin_1.5.0-1PIGSTY~bookworm_amd64.deb
postgresql-15-parray-gin 1.5.0 d12.aarch64 pigsty 30.0 KiB postgresql-15-parray-gin_1.5.0-1PIGSTY~bookworm_arm64.deb
postgresql-15-parray-gin 1.5.0 d13.x86_64 pigsty 30.2 KiB postgresql-15-parray-gin_1.5.0-1PIGSTY~trixie_amd64.deb
postgresql-15-parray-gin 1.5.0 d13.aarch64 pigsty 30.2 KiB postgresql-15-parray-gin_1.5.0-1PIGSTY~trixie_arm64.deb
postgresql-15-parray-gin 1.5.0 u22.x86_64 pigsty 32.8 KiB postgresql-15-parray-gin_1.5.0-1PIGSTY~jammy_amd64.deb
postgresql-15-parray-gin 1.5.0 u22.aarch64 pigsty 32.2 KiB postgresql-15-parray-gin_1.5.0-1PIGSTY~jammy_arm64.deb
postgresql-15-parray-gin 1.5.0 u24.x86_64 pigsty 31.2 KiB postgresql-15-parray-gin_1.5.0-1PIGSTY~noble_amd64.deb
postgresql-15-parray-gin 1.5.0 u24.aarch64 pigsty 31.5 KiB postgresql-15-parray-gin_1.5.0-1PIGSTY~noble_arm64.deb
postgresql-15-parray-gin 1.5.0 u26.x86_64 pigsty 31.1 KiB postgresql-15-parray-gin_1.5.0-1PIGSTY~resolute_amd64.deb
postgresql-15-parray-gin 1.5.0 u26.aarch64 pigsty 31.0 KiB postgresql-15-parray-gin_1.5.0-1PIGSTY~resolute_arm64.deb
Package Version OS ORG SIZE File URL
parray_gin_14 1.5.0 el8.x86_64 pigsty 23.8 KiB parray_gin_14-1.5.0-1PIGSTY.el8.x86_64.rpm
parray_gin_14 1.5.0 el8.aarch64 pigsty 23.6 KiB parray_gin_14-1.5.0-1PIGSTY.el8.aarch64.rpm
parray_gin_14 1.5.0 el9.x86_64 pigsty 23.8 KiB parray_gin_14-1.5.0-1PIGSTY.el9.x86_64.rpm
parray_gin_14 1.5.0 el9.aarch64 pigsty 23.3 KiB parray_gin_14-1.5.0-1PIGSTY.el9.aarch64.rpm
parray_gin_14 1.5.0 el10.x86_64 pigsty 24.0 KiB parray_gin_14-1.5.0-1PIGSTY.el10.x86_64.rpm
parray_gin_14 1.5.0 el10.aarch64 pigsty 23.8 KiB parray_gin_14-1.5.0-1PIGSTY.el10.aarch64.rpm
postgresql-14-parray-gin 1.5.0 d12.x86_64 pigsty 30.1 KiB postgresql-14-parray-gin_1.5.0-1PIGSTY~bookworm_amd64.deb
postgresql-14-parray-gin 1.5.0 d12.aarch64 pigsty 29.9 KiB postgresql-14-parray-gin_1.5.0-1PIGSTY~bookworm_arm64.deb
postgresql-14-parray-gin 1.5.0 d13.x86_64 pigsty 30.2 KiB postgresql-14-parray-gin_1.5.0-1PIGSTY~trixie_amd64.deb
postgresql-14-parray-gin 1.5.0 d13.aarch64 pigsty 30.1 KiB postgresql-14-parray-gin_1.5.0-1PIGSTY~trixie_arm64.deb
postgresql-14-parray-gin 1.5.0 u22.x86_64 pigsty 32.8 KiB postgresql-14-parray-gin_1.5.0-1PIGSTY~jammy_amd64.deb
postgresql-14-parray-gin 1.5.0 u22.aarch64 pigsty 32.2 KiB postgresql-14-parray-gin_1.5.0-1PIGSTY~jammy_arm64.deb
postgresql-14-parray-gin 1.5.0 u24.x86_64 pigsty 31.2 KiB postgresql-14-parray-gin_1.5.0-1PIGSTY~noble_amd64.deb
postgresql-14-parray-gin 1.5.0 u24.aarch64 pigsty 31.5 KiB postgresql-14-parray-gin_1.5.0-1PIGSTY~noble_arm64.deb
postgresql-14-parray-gin 1.5.0 u26.x86_64 pigsty 31.0 KiB postgresql-14-parray-gin_1.5.0-1PIGSTY~resolute_amd64.deb
postgresql-14-parray-gin 1.5.0 u26.aarch64 pigsty 31.0 KiB postgresql-14-parray-gin_1.5.0-1PIGSTY~resolute_arm64.deb

Source

pig build pkg parray_gin;		# build rpm/deb

Install

Make sure PGDG and PIGSTY repo available:

pig repo add pgsql -u   # add both repo and update cache

Install 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 14

Create this extension with:

CREATE EXTENSION parray_gin;

Usage

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 use LIKE patterns.
  • <@@: 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.