pg_bigm
pg_bigm : create 2-gram (bigram) index for faster full text search.
Overview
| ID | Extension | Package | Version | Category | License | Language |
|---|---|---|---|---|---|---|
| 2120 | pg_bigm | pg_bigm | 1.2 |
FTS | PostgreSQL | C |
| Attribute | Has Binary | Has Library | Need Load | Has DDL | Relocatable | Trusted |
|---|---|---|---|---|---|---|
| --sLd-r | No | Yes | Yes | Yes | yes | no |
| Relationships | |
|---|---|
| See Also | pgroonga pg_cjk_parser pg_jieba zhparser pg_tokenizer pg_pinyin unaccent pg_trgm dict_xsyn biscuit vgram |
Packages
| Linux / PG | PG19 | PG18 | PG17 | PG16 | PG15 |
|---|---|---|---|---|---|
| el8.x86_64 | N/A | PGDG 1.2 | PGDG 1.2 | PGDG 1.2 | PGDG 1.2 |
| el8.aarch64 | N/A | PGDG 1.2 | PGDG 1.2 | PGDG 1.2 | PGDG 1.2 |
| el9.x86_64 | PGDG 1.2 | PGDG 1.2 | PGDG 1.2 | PGDG 1.2 | PGDG 1.2 |
| el9.aarch64 | PGDG 1.2 | PGDG 1.2 | PGDG 1.2 | PGDG 1.2 | PGDG 1.2 |
| el10.x86_64 | PGDG 1.2 | PGDG 1.2 | PGDG 1.2 | PGDG 1.2 | PGDG 1.2 |
| el10.aarch64 | PGDG 1.2 | PGDG 1.2 | PGDG 1.2 | PGDG 1.2 | PGDG 1.2 |
| d12.x86_64 | PIGSTY 1.2 | PIGSTY 1.2 | PIGSTY 1.2 | PIGSTY 1.2 | PIGSTY 1.2 |
| d12.aarch64 | PIGSTY 1.2 | PIGSTY 1.2 | PIGSTY 1.2 | PIGSTY 1.2 | PIGSTY 1.2 |
| d13.x86_64 | PIGSTY 1.2 | PIGSTY 1.2 | PIGSTY 1.2 | PIGSTY 1.2 | PIGSTY 1.2 |
| d13.aarch64 | PIGSTY 1.2 | PIGSTY 1.2 | PIGSTY 1.2 | PIGSTY 1.2 | PIGSTY 1.2 |
| u22.x86_64 | PIGSTY 1.2 | PIGSTY 1.2 | PIGSTY 1.2 | PIGSTY 1.2 | PIGSTY 1.2 |
| u22.aarch64 | PIGSTY 1.2 | PIGSTY 1.2 | PIGSTY 1.2 | PIGSTY 1.2 | PIGSTY 1.2 |
| u24.x86_64 | PIGSTY 1.2 | PIGSTY 1.2 | PIGSTY 1.2 | PIGSTY 1.2 | PIGSTY 1.2 |
| u24.aarch64 | PIGSTY 1.2 | PIGSTY 1.2 | PIGSTY 1.2 | PIGSTY 1.2 | PIGSTY 1.2 |
| u26.x86_64 | PIGSTY 1.2 | PIGSTY 1.2 | PIGSTY 1.2 | PIGSTY 1.2 | PIGSTY 1.2 |
| u26.aarch64 | PIGSTY 1.2 | PIGSTY 1.2 | PIGSTY 1.2 | PIGSTY 1.2 | PIGSTY 1.2 |
Source
github.com/pgbigm/pg_bigm
pg_bigm-1.2-20261118.tar.gz
Install
Make sure PGDG and PIGSTY repo available:
Install this extension with pig:
Config this extension to shared_preload_libraries:
Create this extension with:
Usage
Sources:
pg_bigm builds GIN bigram indexes for LIKE and similarity searches, including multibyte text. Release 1.2-20261118 keeps SQL version 1.2 and adds PostgreSQL 19 support.
Search
likequery(text) escapes a literal search keyword for LIKE. show_bigm(text) displays its bigrams, and bigm_similarity(text,text) returns a similarity value. The =% operator applies pg_bigm.similarity_limit, normally 0.3. An index is useful only when the planner selects it.
Settings and maintenance
pg_bigm.enable_recheck normally remains on: disabling rechecks can return false positives. pg_bigm.gin_key_limit defaults to 0 (no limit); a positive value bounds keys used in a search. pg_gin_pending_stats(regclass) reports GIN pending-list pages and tuples. pg_bigm.last_update identifies the library revision.
The 20261118 build fixes incorrect multibyte truncation, LIKE underscore handling and missing similarity matches. The truncation fix requires compilation with headers from PostgreSQL 14.21, 15.16, 16.12, 17.8, 18.2 or later, or PostgreSQL 19; the same extension SQL version does not prove the library contains the correction. Deploy the matching library to all servers and replace processes using the old library. Base use requires no preload.