Skip to content

istore

Integer key/value types with arithmetic, aggregation, and GIN indexing

istore · Integer key/value types with arithmetic, aggregation, and GIN indexing

Overview

IDExtensionPackageVersionCategoryLicenseLanguage
3710istoreistore0.1.12TYPEMITC
AttributeHas BinaryHas LibraryNeed LoadHas DDLRelocatableTrusted
--s-d-rNoYesNoYesyesno
PGXN 0.1.12 source requires the PG16+ varatt/Datum compatibility patch. PostgreSQL 14-18 verified across all 16 PGSTY target platforms. Does not require hstore.

Packages

TypeRepoVersionPG Major CompatibilityPackage PatternDependencies
EXTPIGSTY0.1.1219 18 17 16 15istore-
RPMPIGSTY0.1.1219 18 17 16 15istore_$v-
DEBPIGSTY0.1.1219 18 17 16 15postgresql-$v-istore-
Linux / PGPG19PG18PG17PG16PG15
el8.x86_64N/APIGSTY 0.1.12PIGSTY 0.1.12PIGSTY 0.1.12PIGSTY 0.1.12
el8.aarch64N/APIGSTY 0.1.12PIGSTY 0.1.12PIGSTY 0.1.12PIGSTY 0.1.12
el9.x86_64PIGSTY 0.1.12PIGSTY 0.1.12PIGSTY 0.1.12PIGSTY 0.1.12PIGSTY 0.1.12
el9.aarch64PIGSTY 0.1.12PIGSTY 0.1.12PIGSTY 0.1.12PIGSTY 0.1.12PIGSTY 0.1.12
el10.x86_64PIGSTY 0.1.12PIGSTY 0.1.12PIGSTY 0.1.12PIGSTY 0.1.12PIGSTY 0.1.12
el10.aarch64PIGSTY 0.1.12PIGSTY 0.1.12PIGSTY 0.1.12PIGSTY 0.1.12PIGSTY 0.1.12
d12.x86_64PIGSTY 0.1.12PIGSTY 0.1.12PIGSTY 0.1.12PIGSTY 0.1.12PIGSTY 0.1.12
d12.aarch64PIGSTY 0.1.12PIGSTY 0.1.12PIGSTY 0.1.12PIGSTY 0.1.12PIGSTY 0.1.12
d13.x86_64PIGSTY 0.1.12PIGSTY 0.1.12PIGSTY 0.1.12PIGSTY 0.1.12PIGSTY 0.1.12
d13.aarch64PIGSTY 0.1.12PIGSTY 0.1.12PIGSTY 0.1.12PIGSTY 0.1.12PIGSTY 0.1.12
u22.x86_64PIGSTY 0.1.12PIGSTY 0.1.12PIGSTY 0.1.12PIGSTY 0.1.12PIGSTY 0.1.12
u22.aarch64PIGSTY 0.1.12PIGSTY 0.1.12PIGSTY 0.1.12PIGSTY 0.1.12PIGSTY 0.1.12
u24.x86_64PIGSTY 0.1.12PIGSTY 0.1.12PIGSTY 0.1.12PIGSTY 0.1.12PIGSTY 0.1.12
u24.aarch64PIGSTY 0.1.12PIGSTY 0.1.12PIGSTY 0.1.12PIGSTY 0.1.12PIGSTY 0.1.12
u26.x86_64PIGSTY 0.1.12PIGSTY 0.1.12PIGSTY 0.1.12PIGSTY 0.1.12PIGSTY 0.1.12
u26.aarch64PIGSTY 0.1.12PIGSTY 0.1.12PIGSTY 0.1.12PIGSTY 0.1.12PIGSTY 0.1.12
PackageVersionOSORGSIZEFile URL
istore_190.1.12el9.x86_64pigsty133.4 KiBistore_19-0.1.12-1PGSTY.el9.x86_64.rpm
istore_190.1.12el9.aarch64pigsty131.7 KiBistore_19-0.1.12-1PGSTY.el9.aarch64.rpm
istore_190.1.12el10.x86_64pigsty134.4 KiBistore_19-0.1.12-1PGSTY.el10.x86_64.rpm
istore_190.1.12el10.aarch64pigsty132.3 KiBistore_19-0.1.12-1PGSTY.el10.aarch64.rpm
postgresql-19-istore0.1.12d12.x86_64pigsty113.3 KiBpostgresql-19-istore_0.1.12-1PGSTY~bookworm_amd64.deb
postgresql-19-istore0.1.12d12.aarch64pigsty110.8 KiBpostgresql-19-istore_0.1.12-1PGSTY~bookworm_arm64.deb
postgresql-19-istore0.1.12d13.x86_64pigsty113.6 KiBpostgresql-19-istore_0.1.12-1PGSTY~trixie_amd64.deb
postgresql-19-istore0.1.12d13.aarch64pigsty111.1 KiBpostgresql-19-istore_0.1.12-1PGSTY~trixie_arm64.deb
postgresql-19-istore0.1.12u22.x86_64pigsty125.6 KiBpostgresql-19-istore_0.1.12-1PGSTY~jammy_amd64.deb
postgresql-19-istore0.1.12u22.aarch64pigsty123.6 KiBpostgresql-19-istore_0.1.12-1PGSTY~jammy_arm64.deb
postgresql-19-istore0.1.12u24.x86_64pigsty122.2 KiBpostgresql-19-istore_0.1.12-1PGSTY~noble_amd64.deb
postgresql-19-istore0.1.12u24.aarch64pigsty121.3 KiBpostgresql-19-istore_0.1.12-1PGSTY~noble_arm64.deb
postgresql-19-istore0.1.12u26.x86_64pigsty120.7 KiBpostgresql-19-istore_0.1.12-1PGSTY~resolute_amd64.deb
postgresql-19-istore0.1.12u26.aarch64pigsty119.6 KiBpostgresql-19-istore_0.1.12-1PGSTY~resolute_arm64.deb
PackageVersionOSORGSIZEFile URL
istore_180.1.12el8.x86_64pigsty129.9 KiBistore_18-0.1.12-1PGSTY.el8.x86_64.rpm
istore_180.1.12el8.aarch64pigsty126.7 KiBistore_18-0.1.12-1PGSTY.el8.aarch64.rpm
istore_180.1.12el9.x86_64pigsty133.6 KiBistore_18-0.1.12-1PGSTY.el9.x86_64.rpm
istore_180.1.12el9.aarch64pigsty131.6 KiBistore_18-0.1.12-1PGSTY.el9.aarch64.rpm
istore_180.1.12el10.x86_64pigsty134.3 KiBistore_18-0.1.12-1PGSTY.el10.x86_64.rpm
istore_180.1.12el10.aarch64pigsty132.5 KiBistore_18-0.1.12-1PGSTY.el10.aarch64.rpm
postgresql-18-istore0.1.12d12.x86_64pigsty113.4 KiBpostgresql-18-istore_0.1.12-1PGSTY~bookworm_amd64.deb
postgresql-18-istore0.1.12d12.aarch64pigsty110.6 KiBpostgresql-18-istore_0.1.12-1PGSTY~bookworm_arm64.deb
postgresql-18-istore0.1.12d13.x86_64pigsty113.6 KiBpostgresql-18-istore_0.1.12-1PGSTY~trixie_amd64.deb
postgresql-18-istore0.1.12d13.aarch64pigsty111.0 KiBpostgresql-18-istore_0.1.12-1PGSTY~trixie_arm64.deb
postgresql-18-istore0.1.12u22.x86_64pigsty125.7 KiBpostgresql-18-istore_0.1.12-1PGSTY~jammy_amd64.deb
postgresql-18-istore0.1.12u22.aarch64pigsty123.7 KiBpostgresql-18-istore_0.1.12-1PGSTY~jammy_arm64.deb
postgresql-18-istore0.1.12u24.x86_64pigsty122.1 KiBpostgresql-18-istore_0.1.12-1PGSTY~noble_amd64.deb
postgresql-18-istore0.1.12u24.aarch64pigsty121.2 KiBpostgresql-18-istore_0.1.12-1PGSTY~noble_arm64.deb
postgresql-18-istore0.1.12u26.x86_64pigsty120.9 KiBpostgresql-18-istore_0.1.12-1PGSTY~resolute_amd64.deb
postgresql-18-istore0.1.12u26.aarch64pigsty119.4 KiBpostgresql-18-istore_0.1.12-1PGSTY~resolute_arm64.deb
PackageVersionOSORGSIZEFile URL
istore_170.1.12el8.x86_64pigsty128.8 KiBistore_17-0.1.12-1PGSTY.el8.x86_64.rpm
istore_170.1.12el8.aarch64pigsty125.5 KiBistore_17-0.1.12-1PGSTY.el8.aarch64.rpm
istore_170.1.12el9.x86_64pigsty132.4 KiBistore_17-0.1.12-1PGSTY.el9.x86_64.rpm
istore_170.1.12el9.aarch64pigsty130.5 KiBistore_17-0.1.12-1PGSTY.el9.aarch64.rpm
istore_170.1.12el10.x86_64pigsty133.3 KiBistore_17-0.1.12-1PGSTY.el10.x86_64.rpm
istore_170.1.12el10.aarch64pigsty132.6 KiBistore_17-0.1.12-1PGSTY.el10.aarch64.rpm
postgresql-17-istore0.1.12d12.x86_64pigsty112.3 KiBpostgresql-17-istore_0.1.12-1PGSTY~bookworm_amd64.deb
postgresql-17-istore0.1.12d12.aarch64pigsty109.5 KiBpostgresql-17-istore_0.1.12-1PGSTY~bookworm_arm64.deb
postgresql-17-istore0.1.12d13.x86_64pigsty112.2 KiBpostgresql-17-istore_0.1.12-1PGSTY~trixie_amd64.deb
postgresql-17-istore0.1.12d13.aarch64pigsty109.8 KiBpostgresql-17-istore_0.1.12-1PGSTY~trixie_arm64.deb
postgresql-17-istore0.1.12u22.x86_64pigsty133.7 KiBpostgresql-17-istore_0.1.12-1PGSTY~jammy_amd64.deb
postgresql-17-istore0.1.12u22.aarch64pigsty131.4 KiBpostgresql-17-istore_0.1.12-1PGSTY~jammy_arm64.deb
postgresql-17-istore0.1.12u24.x86_64pigsty121.2 KiBpostgresql-17-istore_0.1.12-1PGSTY~noble_amd64.deb
postgresql-17-istore0.1.12u24.aarch64pigsty120.1 KiBpostgresql-17-istore_0.1.12-1PGSTY~noble_arm64.deb
postgresql-17-istore0.1.12u26.x86_64pigsty120.2 KiBpostgresql-17-istore_0.1.12-1PGSTY~resolute_amd64.deb
postgresql-17-istore0.1.12u26.aarch64pigsty118.3 KiBpostgresql-17-istore_0.1.12-1PGSTY~resolute_arm64.deb
PackageVersionOSORGSIZEFile URL
istore_160.1.12el8.x86_64pigsty128.8 KiBistore_16-0.1.12-1PGSTY.el8.x86_64.rpm
istore_160.1.12el8.aarch64pigsty125.5 KiBistore_16-0.1.12-1PGSTY.el8.aarch64.rpm
istore_160.1.12el9.x86_64pigsty132.4 KiBistore_16-0.1.12-1PGSTY.el9.x86_64.rpm
istore_160.1.12el9.aarch64pigsty130.5 KiBistore_16-0.1.12-1PGSTY.el9.aarch64.rpm
istore_160.1.12el10.x86_64pigsty133.3 KiBistore_16-0.1.12-1PGSTY.el10.x86_64.rpm
istore_160.1.12el10.aarch64pigsty132.6 KiBistore_16-0.1.12-1PGSTY.el10.aarch64.rpm
postgresql-16-istore0.1.12d12.x86_64pigsty112.2 KiBpostgresql-16-istore_0.1.12-1PGSTY~bookworm_amd64.deb
postgresql-16-istore0.1.12d12.aarch64pigsty109.8 KiBpostgresql-16-istore_0.1.12-1PGSTY~bookworm_arm64.deb
postgresql-16-istore0.1.12d13.x86_64pigsty112.4 KiBpostgresql-16-istore_0.1.12-1PGSTY~trixie_amd64.deb
postgresql-16-istore0.1.12d13.aarch64pigsty109.8 KiBpostgresql-16-istore_0.1.12-1PGSTY~trixie_arm64.deb
postgresql-16-istore0.1.12u22.x86_64pigsty133.6 KiBpostgresql-16-istore_0.1.12-1PGSTY~jammy_amd64.deb
postgresql-16-istore0.1.12u22.aarch64pigsty131.3 KiBpostgresql-16-istore_0.1.12-1PGSTY~jammy_arm64.deb
postgresql-16-istore0.1.12u24.x86_64pigsty121.2 KiBpostgresql-16-istore_0.1.12-1PGSTY~noble_amd64.deb
postgresql-16-istore0.1.12u24.aarch64pigsty120.1 KiBpostgresql-16-istore_0.1.12-1PGSTY~noble_arm64.deb
postgresql-16-istore0.1.12u26.x86_64pigsty120.1 KiBpostgresql-16-istore_0.1.12-1PGSTY~resolute_amd64.deb
postgresql-16-istore0.1.12u26.aarch64pigsty118.2 KiBpostgresql-16-istore_0.1.12-1PGSTY~resolute_arm64.deb
PackageVersionOSORGSIZEFile URL
istore_150.1.12el8.x86_64pigsty128.3 KiBistore_15-0.1.12-1PGSTY.el8.x86_64.rpm
istore_150.1.12el8.aarch64pigsty126.4 KiBistore_15-0.1.12-1PGSTY.el8.aarch64.rpm
istore_150.1.12el9.x86_64pigsty129.0 KiBistore_15-0.1.12-1PGSTY.el9.x86_64.rpm
istore_150.1.12el9.aarch64pigsty128.1 KiBistore_15-0.1.12-1PGSTY.el9.aarch64.rpm
istore_150.1.12el10.x86_64pigsty129.9 KiBistore_15-0.1.12-1PGSTY.el10.x86_64.rpm
istore_150.1.12el10.aarch64pigsty129.0 KiBistore_15-0.1.12-1PGSTY.el10.aarch64.rpm
postgresql-15-istore0.1.12d12.x86_64pigsty112.0 KiBpostgresql-15-istore_0.1.12-1PGSTY~bookworm_amd64.deb
postgresql-15-istore0.1.12d12.aarch64pigsty109.0 KiBpostgresql-15-istore_0.1.12-1PGSTY~bookworm_arm64.deb
postgresql-15-istore0.1.12d13.x86_64pigsty112.1 KiBpostgresql-15-istore_0.1.12-1PGSTY~trixie_amd64.deb
postgresql-15-istore0.1.12d13.aarch64pigsty109.3 KiBpostgresql-15-istore_0.1.12-1PGSTY~trixie_arm64.deb
postgresql-15-istore0.1.12u22.x86_64pigsty130.2 KiBpostgresql-15-istore_0.1.12-1PGSTY~jammy_amd64.deb
postgresql-15-istore0.1.12u22.aarch64pigsty127.4 KiBpostgresql-15-istore_0.1.12-1PGSTY~jammy_arm64.deb
postgresql-15-istore0.1.12u24.x86_64pigsty117.7 KiBpostgresql-15-istore_0.1.12-1PGSTY~noble_amd64.deb
postgresql-15-istore0.1.12u24.aarch64pigsty116.3 KiBpostgresql-15-istore_0.1.12-1PGSTY~noble_arm64.deb
postgresql-15-istore0.1.12u26.x86_64pigsty116.7 KiBpostgresql-15-istore_0.1.12-1PGSTY~resolute_amd64.deb
postgresql-15-istore0.1.12u26.aarch64pigsty114.9 KiBpostgresql-15-istore_0.1.12-1PGSTY~resolute_arm64.deb

Source

pig build pkg istore;		# 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 istore;		# install by package name

pig install istore -v 19;   # install for PG 19
pig install istore -v 18;   # install for PG 18
pig install istore -v 17;   # install for PG 17
pig install istore -v 16;   # install for PG 16
pig install istore -v 15;   # install for PG 15

Create this extension with:

CREATE EXTENSION istore;

Usage

Sources:

istore provides compact integer-key maps for PostgreSQL. The istore type stores integer values, while bigistore stores bigint values; both are useful for sparse counters, distributions, and analytical aggregates keyed by integer identifiers.

Core Workflow

Text input resembles hstore, and array constructors can aggregate repeated keys:

CREATE EXTENSION istore;

SELECT istore(ARRAY[1, 2, 1, 3, 2, 2]);
SELECT '1=>4,2=>5'::istore -> 1;
SELECT '1=>4,2=>5'::istore + '1=>4,3=>6'::istore;

CREATE INDEX metrics_keys_idx
  ON metrics USING gin (values istore_key_ops);

Key lookup uses ->; ?, ?&, and ?| test key presence. || concatenates stores, while arithmetic operators combine matching keys. The istore_key_ops GIN operator class accelerates key-existence predicates.

Important Objects and Caveats

Constructors and transforms include istore(...), bigistore(...), akeys, avals, each, slice, compact, fill_gaps, accumulate, clamp, and delete helpers. sum_up summarizes values, and aggregate SUM returns bigistore so that totals have a wider value type. Per-key minimum and maximum aggregates are also provided.

The cast from istore to bigistore is implicit; narrowing assignments can overflow. Arithmetic and division still require application-level checks for overflow and zero divisors. Large values can be TOASTed, and GIN indexes add write and maintenance cost, so benchmark the actual distribution and update workload instead of treating upstream examples as performance guarantees.

Table reader