pg_fts
Overview
| Package | Version | Category | License | Language |
|---|---|---|---|---|
pg_fts | 1.12.0 | FTS | PostgreSQL | C |
| ID | Extension | Bin | Lib | Load | Create | Trust | Reloc | Schema |
|---|---|---|---|---|---|---|---|---|
| 2230 | pg_fts | No | Yes | No | Yes | Yes | Yes | - |
| Related | pg_search pg_textsearch pg_bestmatch vchord_bm25 pg_rrf pgroonga psql_bm25s pgcontext vectorize |
|---|
PG17-18; trusted and relocatable.
Version
| Type | Repo | Version | PG Ver | Package | Deps |
|---|---|---|---|---|---|
| EXT | PIGSTY | 1.12.0 | 1817161514 | pg_fts | - |
| RPM | PIGSTY | 1.12.0 | 1817161514 | pg_fts_$v | - |
| DEB | PIGSTY | 1.12.0 | 1817161514 | postgresql-$v-pg-fts | - |
| OS / PG | PG18 | PG17 | PG16 | PG15 | PG14 |
|---|---|---|---|---|---|
| el8.x86_64 | PIGSTY 1.9.0 el8.x86_64.pg18 : pg_fts_18 pg_fts_18-1.9.0-1PGSTY.el8.x86_64.rpm
| PIGSTY 1.9.0 el8.x86_64.pg17 : pg_fts_17 pg_fts_17-1.9.0-1PGSTY.el8.x86_64.rpm
| N/A | N/A | N/A |
| el8.aarch64 | PIGSTY 1.9.0 el8.aarch64.pg18 : pg_fts_18 pg_fts_18-1.9.0-1PGSTY.el8.aarch64.rpm
| PIGSTY 1.9.0 el8.aarch64.pg17 : pg_fts_17 pg_fts_17-1.9.0-1PGSTY.el8.aarch64.rpm
| N/A | N/A | N/A |
| el9.x86_64 | PIGSTY 1.9.0 el9.x86_64.pg18 : pg_fts_18 pg_fts_18-1.9.0-1PGSTY.el9.x86_64.rpm
| PIGSTY 1.9.0 el9.x86_64.pg17 : pg_fts_17 pg_fts_17-1.9.0-1PGSTY.el9.x86_64.rpm
| N/A | N/A | N/A |
| el9.aarch64 | PIGSTY 1.9.0 el9.aarch64.pg18 : pg_fts_18 pg_fts_18-1.9.0-1PGSTY.el9.aarch64.rpm
| PIGSTY 1.9.0 el9.aarch64.pg17 : pg_fts_17 pg_fts_17-1.9.0-1PGSTY.el9.aarch64.rpm
| N/A | N/A | N/A |
| el10.x86_64 | PIGSTY 1.9.0 el10.x86_64.pg18 : pg_fts_18 pg_fts_18-1.9.0-1PGSTY.el10.x86_64.rpm
| PIGSTY 1.9.0 el10.x86_64.pg17 : pg_fts_17 pg_fts_17-1.9.0-1PGSTY.el10.x86_64.rpm
| N/A | N/A | N/A |
| el10.aarch64 | PIGSTY 1.9.0 el10.aarch64.pg18 : pg_fts_18 pg_fts_18-1.9.0-1PGSTY.el10.aarch64.rpm
| PIGSTY 1.9.0 el10.aarch64.pg17 : pg_fts_17 pg_fts_17-1.9.0-1PGSTY.el10.aarch64.rpm
| N/A | N/A | N/A |
| d12.x86_64 | PIGSTY 1.9.0 d12.x86_64.pg18 : postgresql-18-pg-fts postgresql-18-pg-fts_1.9.0-1PGSTY~bookworm_amd64.deb
| PIGSTY 1.9.0 d12.x86_64.pg17 : postgresql-17-pg-fts postgresql-17-pg-fts_1.9.0-1PGSTY~bookworm_amd64.deb
| N/A | N/A | N/A |
| d12.aarch64 | PIGSTY 1.9.0 d12.aarch64.pg18 : postgresql-18-pg-fts postgresql-18-pg-fts_1.9.0-1PGSTY~bookworm_arm64.deb
| PIGSTY 1.9.0 d12.aarch64.pg17 : postgresql-17-pg-fts postgresql-17-pg-fts_1.9.0-1PGSTY~bookworm_arm64.deb
| N/A | N/A | N/A |
| d13.x86_64 | PIGSTY 1.9.0 d13.x86_64.pg18 : postgresql-18-pg-fts postgresql-18-pg-fts_1.9.0-1PGSTY~trixie_amd64.deb
| PIGSTY 1.9.0 d13.x86_64.pg17 : postgresql-17-pg-fts postgresql-17-pg-fts_1.9.0-1PGSTY~trixie_amd64.deb
| N/A | N/A | N/A |
| d13.aarch64 | PIGSTY 1.9.0 d13.aarch64.pg18 : postgresql-18-pg-fts postgresql-18-pg-fts_1.9.0-1PGSTY~trixie_arm64.deb
| PIGSTY 1.9.0 d13.aarch64.pg17 : postgresql-17-pg-fts postgresql-17-pg-fts_1.9.0-1PGSTY~trixie_arm64.deb
| N/A | N/A | N/A |
| u22.x86_64 | PIGSTY 1.9.0 u22.x86_64.pg18 : postgresql-18-pg-fts postgresql-18-pg-fts_1.9.0-1PGSTY~jammy_amd64.deb
| PIGSTY 1.9.0 u22.x86_64.pg17 : postgresql-17-pg-fts postgresql-17-pg-fts_1.9.0-1PGSTY~jammy_amd64.deb
| N/A | N/A | N/A |
| u22.aarch64 | PIGSTY 1.9.0 u22.aarch64.pg18 : postgresql-18-pg-fts postgresql-18-pg-fts_1.9.0-1PGSTY~jammy_arm64.deb
| PIGSTY 1.9.0 u22.aarch64.pg17 : postgresql-17-pg-fts postgresql-17-pg-fts_1.9.0-1PGSTY~jammy_arm64.deb
| N/A | N/A | N/A |
| u24.x86_64 | PIGSTY 1.9.0 u24.x86_64.pg18 : postgresql-18-pg-fts postgresql-18-pg-fts_1.9.0-1PGSTY~noble_amd64.deb
| PIGSTY 1.9.0 u24.x86_64.pg17 : postgresql-17-pg-fts postgresql-17-pg-fts_1.9.0-1PGSTY~noble_amd64.deb
| N/A | N/A | N/A |
| u24.aarch64 | PIGSTY 1.9.0 u24.aarch64.pg18 : postgresql-18-pg-fts postgresql-18-pg-fts_1.9.0-1PGSTY~noble_arm64.deb
| PIGSTY 1.9.0 u24.aarch64.pg17 : postgresql-17-pg-fts postgresql-17-pg-fts_1.9.0-1PGSTY~noble_arm64.deb
| N/A | N/A | N/A |
| u26.x86_64 | PIGSTY 1.9.0 u26.x86_64.pg18 : postgresql-18-pg-fts postgresql-18-pg-fts_1.9.0-1PGSTY~resolute_amd64.deb
| PIGSTY 1.9.0 u26.x86_64.pg17 : postgresql-17-pg-fts postgresql-17-pg-fts_1.9.0-1PGSTY~resolute_amd64.deb
| N/A | N/A | N/A |
| u26.aarch64 | PIGSTY 1.9.0 u26.aarch64.pg18 : postgresql-18-pg-fts postgresql-18-pg-fts_1.9.0-1PGSTY~resolute_arm64.deb
| PIGSTY 1.9.0 u26.aarch64.pg17 : postgresql-17-pg-fts postgresql-17-pg-fts_1.9.0-1PGSTY~resolute_arm64.deb
| N/A | N/A | N/A |
Build
You can build the RPM / DEB packages for pg_fts using pig build:
Install
You can install pg_fts directly. First, make sure the PGDG and PIGSTY repositories are added and enabled:
Install the extension using pig or apt/yum/dnf:
Create Extension:
Usage
Sources:
pg_fts 1.12.0 provides full-text search with BM25/BM25F ranking and the dedicated fts inverted index. PostgreSQL 17 and 18 are supported; PostgreSQL 19/master CI is best-effort. The control is trusted and relocatable, and core use needs no shared preload.
Search and Rank
Objects and Queries
ftsdoc and ftsquery represent analyzed documents and queries. to_ftsdoc() and to_ftsquery() construct them; @@@ matches documents and <=> orders relevance distance. The match predicate is required for an indexed KNN ordering scan. Queries support boolean terms, phrases, prefix, fuzzy and regular-expression matching. Multi-column documents support BM25F field weighting. fts_count() and ordinary count queries can use exact index counting; fts_search() exposes direct ranked results. Regex/long-fuzzy acceleration is opt-in through trigrams = on.
Maintenance and Privileges
Pending inserts are immediately searchable; merging is not a visibility prerequisite. fts_merge() compacts segments and fts_vacuum() reclaims physical space. Both write WAL, require index ownership and must run on a primary. Large pending documents can temporarily consume substantial space, so merge and reclaim periodically during bulk ingestion. fts_search() and fts_anomalous_docs() expose indexed content and are revoked from PUBLIC by default; widen access only deliberately. Regular table-query visibility and direct helper access are different permission surfaces.
Upgrade to 1.10.0
After installing matching files, run ALTER EXTENSION pg_fts UPDATE TO '1.10.0'. Version 1.10.0 shares each segment’s document-length array across backends by default and adds fts_shared_doclen_stats() to inspect the shared cache. A superuser can change pg_fts.shared_doclen; unavailable shared memory falls back to a private copy. There is no on-disk format change and no REINDEX requirement. Earlier delete-ranking and posting-block fixes remain included; distinguish shared-cache memory from fallback per-backend copies when planning capacity.
Version 1.11.0
Version 1.11.0 fixes wrong-result cases and concurrent insert/VACUUM/merge failures. Ranked traversal uses best-first block ordering; pg_fts.bestfirst defaults on. The index format is unchanged and the SQL upgrade adds no objects. REINDEX is not required merely to upgrade, but it repairs index entries already left or lost by the earlier bugs.
Version 1.12.0
Version 1.12.0 caches the segment dictionary index in each backend, charging it against pg_fts.doclen_cache_mb; a segment that does not fit falls back to the page-chain lookup. Changes to that budget now take effect without waiting for a segment-directory change. There is no index-format change, no new SQL object and no REINDEX requirement. A cancellation or error during cache reconstruction can leave memory allocated until that backend exits; this known limitation does not change query results.
Was this page helpful?
Thanks—your feedback helps us improve this page.
What got in the way? (optional)