Skip to content

stannum

Experimental TINQL text search with BM25 and segmented indexes

stannum · Experimental TINQL text search with BM25 and segmented indexes

Overview

IDExtensionPackageVersionCategoryLicenseLanguage
2320stannumstannum0.1.0FTSAGPL-3.0-or-laterRust
AttributeHas BinaryHas LibraryNeed LoadHas DDLRelocatableTrusted
--s-d--NoYesNoYesnono
Relationships
Schemasstannum
See Alsotin pg_search
Unreleased 0.1.0-dev snapshot; no version release/tag. Conflicts with tin in the same database. Optional preload enables maintenance workers and standby index reads; preload must match on primary and standbys.

Packages

TypeRepoVersionPG Major CompatibilityPackage PatternDependencies
EXTPIGSTY0.1.019 18 17 16 15stannum-
RPMPIGSTY0.1.019 18 17 16 15stannum_$v-
DEBPIGSTY0.1.019 18 17 16 15postgresql-$v-stannum-
Linux / PGPG19PG18PG17PG16PG15
el8.x86_64N/APIGSTY 0.1.0PIGSTY 0.1.0N/AN/A
el8.aarch64N/APIGSTY 0.1.0PIGSTY 0.1.0N/AN/A
el9.x86_64N/APIGSTY 0.1.0PIGSTY 0.1.0N/AN/A
el9.aarch64N/APIGSTY 0.1.0PIGSTY 0.1.0N/AN/A
el10.x86_64N/APIGSTY 0.1.0PIGSTY 0.1.0N/AN/A
el10.aarch64N/APIGSTY 0.1.0PIGSTY 0.1.0N/AN/A
d12.x86_64N/APIGSTY 0.1.0PIGSTY 0.1.0N/AN/A
d12.aarch64N/APIGSTY 0.1.0PIGSTY 0.1.0N/AN/A
d13.x86_64N/APIGSTY 0.1.0PIGSTY 0.1.0N/AN/A
d13.aarch64N/APIGSTY 0.1.0PIGSTY 0.1.0N/AN/A
u22.x86_64N/APIGSTY 0.1.0PIGSTY 0.1.0N/AN/A
u22.aarch64N/APIGSTY 0.1.0PIGSTY 0.1.0N/AN/A
u24.x86_64N/APIGSTY 0.1.0PIGSTY 0.1.0N/AN/A
u24.aarch64N/APIGSTY 0.1.0PIGSTY 0.1.0N/AN/A
u26.x86_64N/APIGSTY 0.1.0PIGSTY 0.1.0N/AN/A
u26.aarch64N/APIGSTY 0.1.0PIGSTY 0.1.0N/AN/A
PackageVersionOSORGSIZEFile URL
stannum_180.1.0el8.x86_64pigsty3.5 MiBstannum_18-0.1.0-1PGSTY.el8.x86_64.rpm
stannum_180.1.0el8.aarch64pigsty3.1 MiBstannum_18-0.1.0-1PGSTY.el8.aarch64.rpm
stannum_180.1.0el9.x86_64pigsty3.6 MiBstannum_18-0.1.0-2PGSTY.el9.x86_64.rpm
stannum_180.1.0el9.aarch64pigsty3.5 MiBstannum_18-0.1.0-2PGSTY.el9.aarch64.rpm
stannum_180.1.0el10.x86_64pigsty3.6 MiBstannum_18-0.1.0-2PGSTY.el10.x86_64.rpm
stannum_180.1.0el10.aarch64pigsty3.5 MiBstannum_18-0.1.0-2PGSTY.el10.aarch64.rpm
postgresql-18-stannum0.1.0d12.x86_64pigsty2.5 MiBpostgresql-18-stannum_0.1.0-2PGSTY~bookworm_amd64.deb
postgresql-18-stannum0.1.0d12.aarch64pigsty2.2 MiBpostgresql-18-stannum_0.1.0-2PGSTY~bookworm_arm64.deb
postgresql-18-stannum0.1.0d13.x86_64pigsty2.5 MiBpostgresql-18-stannum_0.1.0-2PGSTY~trixie_amd64.deb
postgresql-18-stannum0.1.0d13.aarch64pigsty2.2 MiBpostgresql-18-stannum_0.1.0-2PGSTY~trixie_arm64.deb
postgresql-18-stannum0.1.0u22.x86_64pigsty2.7 MiBpostgresql-18-stannum_0.1.0-2PGSTY~jammy_amd64.deb
postgresql-18-stannum0.1.0u22.aarch64pigsty2.7 MiBpostgresql-18-stannum_0.1.0-2PGSTY~jammy_arm64.deb
postgresql-18-stannum0.1.0u24.x86_64pigsty2.7 MiBpostgresql-18-stannum_0.1.0-2PGSTY~noble_amd64.deb
postgresql-18-stannum0.1.0u24.aarch64pigsty2.6 MiBpostgresql-18-stannum_0.1.0-2PGSTY~noble_arm64.deb
postgresql-18-stannum0.1.0u26.x86_64pigsty2.7 MiBpostgresql-18-stannum_0.1.0-2PGSTY~resolute_amd64.deb
postgresql-18-stannum0.1.0u26.aarch64pigsty2.6 MiBpostgresql-18-stannum_0.1.0-2PGSTY~resolute_arm64.deb
PackageVersionOSORGSIZEFile URL
stannum_170.1.0el8.x86_64pigsty3.5 MiBstannum_17-0.1.0-1PGSTY.el8.x86_64.rpm
stannum_170.1.0el8.aarch64pigsty3.1 MiBstannum_17-0.1.0-1PGSTY.el8.aarch64.rpm
stannum_170.1.0el9.x86_64pigsty3.6 MiBstannum_17-0.1.0-2PGSTY.el9.x86_64.rpm
stannum_170.1.0el9.aarch64pigsty3.5 MiBstannum_17-0.1.0-2PGSTY.el9.aarch64.rpm
stannum_170.1.0el10.x86_64pigsty3.6 MiBstannum_17-0.1.0-2PGSTY.el10.x86_64.rpm
stannum_170.1.0el10.aarch64pigsty3.5 MiBstannum_17-0.1.0-2PGSTY.el10.aarch64.rpm
postgresql-17-stannum0.1.0d12.x86_64pigsty2.5 MiBpostgresql-17-stannum_0.1.0-2PGSTY~bookworm_amd64.deb
postgresql-17-stannum0.1.0d12.aarch64pigsty2.2 MiBpostgresql-17-stannum_0.1.0-2PGSTY~bookworm_arm64.deb
postgresql-17-stannum0.1.0d13.x86_64pigsty2.5 MiBpostgresql-17-stannum_0.1.0-2PGSTY~trixie_amd64.deb
postgresql-17-stannum0.1.0d13.aarch64pigsty2.2 MiBpostgresql-17-stannum_0.1.0-2PGSTY~trixie_arm64.deb
postgresql-17-stannum0.1.0u22.x86_64pigsty2.7 MiBpostgresql-17-stannum_0.1.0-2PGSTY~jammy_amd64.deb
postgresql-17-stannum0.1.0u22.aarch64pigsty2.7 MiBpostgresql-17-stannum_0.1.0-2PGSTY~jammy_arm64.deb
postgresql-17-stannum0.1.0u24.x86_64pigsty2.7 MiBpostgresql-17-stannum_0.1.0-2PGSTY~noble_amd64.deb
postgresql-17-stannum0.1.0u24.aarch64pigsty2.6 MiBpostgresql-17-stannum_0.1.0-2PGSTY~noble_arm64.deb
postgresql-17-stannum0.1.0u26.x86_64pigsty2.7 MiBpostgresql-17-stannum_0.1.0-2PGSTY~resolute_amd64.deb
postgresql-17-stannum0.1.0u26.aarch64pigsty2.6 MiBpostgresql-17-stannum_0.1.0-2PGSTY~resolute_arm64.deb

Source

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

pig install stannum -v 18;   # install for PG 18
pig install stannum -v 17;   # install for PG 17

Create this extension with:

CREATE EXTENSION stannum;

Usage

Sources:

stannum is an experimental text-search extension derived from Lead, with persistent indexes, Boolean and phrase queries, and BM25 scoring. The reviewed 0.1.0 source has its own extension identity and storage format.

Core Workflow

CREATE EXTENSION stannum;
CREATE TABLE documents (id bigint GENERATED ALWAYS AS IDENTITY PRIMARY KEY, body text);
INSERT INTO documents (body) VALUES
  ('PostgreSQL supports full text search'), ('Search with exact phrase matching');
CREATE INDEX documents_search ON documents USING stannum (body);
ANALYZE documents;
SELECT id, stannum.full_score(ctid) AS score
FROM documents WHERE body ==> 'search' ORDER BY score DESC LIMIT 10;
SELECT * FROM stannum.segment_info('documents_search');
SELECT * FROM stannum.verify_index('documents_search', heap_check => true);

Operation and Compatibility

The ==> operator accepts TINQL. stannum.highlight marks matching text; stannum.segment_info inspects index segments and stannum.verify_index checks their consistency, optionally against the heap. Index maintenance follows PostgreSQL writes and vacuum.

PostgreSQL 17 and 18 are build targets, with most current lifecycle evidence on 18. A superuser installs the extension in its fixed stannum schema. Primary-server use loads on demand. For standby index reads, add the library to shared_preload_libraries on both primary and standbys and restart those servers.

Migration Boundary

Do not install tin and stannum in the same database: their global ==> operator conflicts. There is no supported in-place migration from the earlier extension names or storage layouts. Treat this as experimental software and validate recovery and maintenance on the intended workload.

Table reader