Skip to content

pg_icu_parser

Full text search parser using ICU boundary analysis

pg_icu_parser : Full text search parser using ICU boundary analysis

Overview

ID Extension Package Version Category License Language
2300 pg_icu_parser pg_icu_parser 1.0 FTS MPL-2.0 C
Attribute Has Binary Has Library Need Load Has DDL Relocatable Trusted
--s-d-r No Yes No Yes yes no
SQL/control version 1.0; upstream release 1.0.0. Local RPM/DEB builds support PG14-18 with a PG18 encoding-API compatibility patch and explicit ICU linkage. ts_headline is unsupported. PIGSTY PG14-18 packages verified across EL8/9/10, Debian 12/13 and Ubuntu 22.04/24.04/26.04 on x86_64/amd64 and aarch64/arm64; all 16 platforms imported into the local PIGSTY repository.

Packages

Type Repo Version PG Major Compatibility Package Pattern Dependencies
EXT PIGSTY 1.0 18 17 16 15 14 pg_icu_parser -
RPM PIGSTY 1.0.0 18 17 16 15 14 pg_icu_parser_$v -
DEB PIGSTY 1.0.0 18 17 16 15 14 postgresql-$v-pg-icu-parser -
Linux / PG PG18 PG17 PG16 PG15 PG14
el8.x86_64 PIGSTY 1.0.0 PIGSTY 1.0.0 PIGSTY 1.0.0 PIGSTY 1.0.0 PIGSTY 1.0.0
el8.aarch64 PIGSTY 1.0.0 PIGSTY 1.0.0 PIGSTY 1.0.0 PIGSTY 1.0.0 PIGSTY 1.0.0
el9.x86_64 PIGSTY 1.0.0 PIGSTY 1.0.0 PIGSTY 1.0.0 PIGSTY 1.0.0 PIGSTY 1.0.0
el9.aarch64 PIGSTY 1.0.0 PIGSTY 1.0.0 PIGSTY 1.0.0 PIGSTY 1.0.0 PIGSTY 1.0.0
el10.x86_64 PIGSTY 1.0.0 PIGSTY 1.0.0 PIGSTY 1.0.0 PIGSTY 1.0.0 PIGSTY 1.0.0
el10.aarch64 PIGSTY 1.0.0 PIGSTY 1.0.0 PIGSTY 1.0.0 PIGSTY 1.0.0 PIGSTY 1.0.0
d12.x86_64 PIGSTY 1.0.0 PIGSTY 1.0.0 PIGSTY 1.0.0 PIGSTY 1.0.0 PIGSTY 1.0.0
d12.aarch64 PIGSTY 1.0.0 PIGSTY 1.0.0 PIGSTY 1.0.0 PIGSTY 1.0.0 PIGSTY 1.0.0
d13.x86_64 PIGSTY 1.0.0 PIGSTY 1.0.0 PIGSTY 1.0.0 PIGSTY 1.0.0 PIGSTY 1.0.0
d13.aarch64 PIGSTY 1.0.0 PIGSTY 1.0.0 PIGSTY 1.0.0 PIGSTY 1.0.0 PIGSTY 1.0.0
u22.x86_64 PIGSTY 1.0.0 PIGSTY 1.0.0 PIGSTY 1.0.0 PIGSTY 1.0.0 PIGSTY 1.0.0
u22.aarch64 PIGSTY 1.0.0 PIGSTY 1.0.0 PIGSTY 1.0.0 PIGSTY 1.0.0 PIGSTY 1.0.0
u24.x86_64 PIGSTY 1.0.0 PIGSTY 1.0.0 PIGSTY 1.0.0 PIGSTY 1.0.0 PIGSTY 1.0.0
u24.aarch64 PIGSTY 1.0.0 PIGSTY 1.0.0 PIGSTY 1.0.0 PIGSTY 1.0.0 PIGSTY 1.0.0
u26.x86_64 PIGSTY 1.0.0 PIGSTY 1.0.0 PIGSTY 1.0.0 PIGSTY 1.0.0 PIGSTY 1.0.0
u26.aarch64 PIGSTY 1.0.0 PIGSTY 1.0.0 PIGSTY 1.0.0 PIGSTY 1.0.0 PIGSTY 1.0.0
Package Version OS ORG SIZE File URL
pg_icu_parser_18 1.0.0 el8.x86_64 pigsty 28.2 KiB pg_icu_parser_18-1.0.0-1PGSTY.el8.x86_64.rpm
pg_icu_parser_18 1.0.0 el8.aarch64 pigsty 28.4 KiB pg_icu_parser_18-1.0.0-1PGSTY.el8.aarch64.rpm
pg_icu_parser_18 1.0.0 el9.x86_64 pigsty 28.6 KiB pg_icu_parser_18-1.0.0-1PGSTY.el9.x86_64.rpm
pg_icu_parser_18 1.0.0 el9.aarch64 pigsty 28.6 KiB pg_icu_parser_18-1.0.0-1PGSTY.el9.aarch64.rpm
pg_icu_parser_18 1.0.0 el10.x86_64 pigsty 28.6 KiB pg_icu_parser_18-1.0.0-1PGSTY.el10.x86_64.rpm
pg_icu_parser_18 1.0.0 el10.aarch64 pigsty 28.9 KiB pg_icu_parser_18-1.0.0-1PGSTY.el10.aarch64.rpm
postgresql-18-pg-icu-parser 1.0.0 d12.x86_64 pigsty 20.0 KiB postgresql-18-pg-icu-parser_1.0.0-1PGSTY~bookworm_amd64.deb
postgresql-18-pg-icu-parser 1.0.0 d12.aarch64 pigsty 19.8 KiB postgresql-18-pg-icu-parser_1.0.0-1PGSTY~bookworm_arm64.deb
postgresql-18-pg-icu-parser 1.0.0 d13.x86_64 pigsty 20.0 KiB postgresql-18-pg-icu-parser_1.0.0-1PGSTY~trixie_amd64.deb
postgresql-18-pg-icu-parser 1.0.0 d13.aarch64 pigsty 19.9 KiB postgresql-18-pg-icu-parser_1.0.0-1PGSTY~trixie_arm64.deb
postgresql-18-pg-icu-parser 1.0.0 u22.x86_64 pigsty 20.8 KiB postgresql-18-pg-icu-parser_1.0.0-1PGSTY~jammy_amd64.deb
postgresql-18-pg-icu-parser 1.0.0 u22.aarch64 pigsty 20.9 KiB postgresql-18-pg-icu-parser_1.0.0-1PGSTY~jammy_arm64.deb
postgresql-18-pg-icu-parser 1.0.0 u24.x86_64 pigsty 21.0 KiB postgresql-18-pg-icu-parser_1.0.0-1PGSTY~noble_amd64.deb
postgresql-18-pg-icu-parser 1.0.0 u24.aarch64 pigsty 20.5 KiB postgresql-18-pg-icu-parser_1.0.0-1PGSTY~noble_arm64.deb
postgresql-18-pg-icu-parser 1.0.0 u26.x86_64 pigsty 20.7 KiB postgresql-18-pg-icu-parser_1.0.0-1PGSTY~resolute_amd64.deb
postgresql-18-pg-icu-parser 1.0.0 u26.aarch64 pigsty 20.9 KiB postgresql-18-pg-icu-parser_1.0.0-1PGSTY~resolute_arm64.deb
Package Version OS ORG SIZE File URL
pg_icu_parser_17 1.0.0 el8.x86_64 pigsty 28.1 KiB pg_icu_parser_17-1.0.0-1PGSTY.el8.x86_64.rpm
pg_icu_parser_17 1.0.0 el8.aarch64 pigsty 28.4 KiB pg_icu_parser_17-1.0.0-1PGSTY.el8.aarch64.rpm
pg_icu_parser_17 1.0.0 el9.x86_64 pigsty 28.6 KiB pg_icu_parser_17-1.0.0-1PGSTY.el9.x86_64.rpm
pg_icu_parser_17 1.0.0 el9.aarch64 pigsty 28.6 KiB pg_icu_parser_17-1.0.0-1PGSTY.el9.aarch64.rpm
pg_icu_parser_17 1.0.0 el10.x86_64 pigsty 28.6 KiB pg_icu_parser_17-1.0.0-1PGSTY.el10.x86_64.rpm
pg_icu_parser_17 1.0.0 el10.aarch64 pigsty 28.8 KiB pg_icu_parser_17-1.0.0-1PGSTY.el10.aarch64.rpm
postgresql-17-pg-icu-parser 1.0.0 d12.x86_64 pigsty 19.9 KiB postgresql-17-pg-icu-parser_1.0.0-1PGSTY~bookworm_amd64.deb
postgresql-17-pg-icu-parser 1.0.0 d12.aarch64 pigsty 19.8 KiB postgresql-17-pg-icu-parser_1.0.0-1PGSTY~bookworm_arm64.deb
postgresql-17-pg-icu-parser 1.0.0 d13.x86_64 pigsty 19.9 KiB postgresql-17-pg-icu-parser_1.0.0-1PGSTY~trixie_amd64.deb
postgresql-17-pg-icu-parser 1.0.0 d13.aarch64 pigsty 19.9 KiB postgresql-17-pg-icu-parser_1.0.0-1PGSTY~trixie_arm64.deb
postgresql-17-pg-icu-parser 1.0.0 u22.x86_64 pigsty 21.5 KiB postgresql-17-pg-icu-parser_1.0.0-1PGSTY~jammy_amd64.deb
postgresql-17-pg-icu-parser 1.0.0 u22.aarch64 pigsty 21.6 KiB postgresql-17-pg-icu-parser_1.0.0-1PGSTY~jammy_arm64.deb
postgresql-17-pg-icu-parser 1.0.0 u24.x86_64 pigsty 21.0 KiB postgresql-17-pg-icu-parser_1.0.0-1PGSTY~noble_amd64.deb
postgresql-17-pg-icu-parser 1.0.0 u24.aarch64 pigsty 20.4 KiB postgresql-17-pg-icu-parser_1.0.0-1PGSTY~noble_arm64.deb
postgresql-17-pg-icu-parser 1.0.0 u26.x86_64 pigsty 20.7 KiB postgresql-17-pg-icu-parser_1.0.0-1PGSTY~resolute_amd64.deb
postgresql-17-pg-icu-parser 1.0.0 u26.aarch64 pigsty 20.9 KiB postgresql-17-pg-icu-parser_1.0.0-1PGSTY~resolute_arm64.deb
Package Version OS ORG SIZE File URL
pg_icu_parser_16 1.0.0 el8.x86_64 pigsty 28.2 KiB pg_icu_parser_16-1.0.0-1PGSTY.el8.x86_64.rpm
pg_icu_parser_16 1.0.0 el8.aarch64 pigsty 28.4 KiB pg_icu_parser_16-1.0.0-1PGSTY.el8.aarch64.rpm
pg_icu_parser_16 1.0.0 el9.x86_64 pigsty 28.6 KiB pg_icu_parser_16-1.0.0-1PGSTY.el9.x86_64.rpm
pg_icu_parser_16 1.0.0 el9.aarch64 pigsty 28.6 KiB pg_icu_parser_16-1.0.0-1PGSTY.el9.aarch64.rpm
pg_icu_parser_16 1.0.0 el10.x86_64 pigsty 28.6 KiB pg_icu_parser_16-1.0.0-1PGSTY.el10.x86_64.rpm
pg_icu_parser_16 1.0.0 el10.aarch64 pigsty 28.8 KiB pg_icu_parser_16-1.0.0-1PGSTY.el10.aarch64.rpm
postgresql-16-pg-icu-parser 1.0.0 d12.x86_64 pigsty 19.9 KiB postgresql-16-pg-icu-parser_1.0.0-1PGSTY~bookworm_amd64.deb
postgresql-16-pg-icu-parser 1.0.0 d12.aarch64 pigsty 19.8 KiB postgresql-16-pg-icu-parser_1.0.0-1PGSTY~bookworm_arm64.deb
postgresql-16-pg-icu-parser 1.0.0 d13.x86_64 pigsty 19.9 KiB postgresql-16-pg-icu-parser_1.0.0-1PGSTY~trixie_amd64.deb
postgresql-16-pg-icu-parser 1.0.0 d13.aarch64 pigsty 19.9 KiB postgresql-16-pg-icu-parser_1.0.0-1PGSTY~trixie_arm64.deb
postgresql-16-pg-icu-parser 1.0.0 u22.x86_64 pigsty 21.5 KiB postgresql-16-pg-icu-parser_1.0.0-1PGSTY~jammy_amd64.deb
postgresql-16-pg-icu-parser 1.0.0 u22.aarch64 pigsty 21.6 KiB postgresql-16-pg-icu-parser_1.0.0-1PGSTY~jammy_arm64.deb
postgresql-16-pg-icu-parser 1.0.0 u24.x86_64 pigsty 21.0 KiB postgresql-16-pg-icu-parser_1.0.0-1PGSTY~noble_amd64.deb
postgresql-16-pg-icu-parser 1.0.0 u24.aarch64 pigsty 20.7 KiB postgresql-16-pg-icu-parser_1.0.0-1PGSTY~noble_arm64.deb
postgresql-16-pg-icu-parser 1.0.0 u26.x86_64 pigsty 20.7 KiB postgresql-16-pg-icu-parser_1.0.0-1PGSTY~resolute_amd64.deb
postgresql-16-pg-icu-parser 1.0.0 u26.aarch64 pigsty 20.9 KiB postgresql-16-pg-icu-parser_1.0.0-1PGSTY~resolute_arm64.deb
Package Version OS ORG SIZE File URL
pg_icu_parser_15 1.0.0 el8.x86_64 pigsty 28.1 KiB pg_icu_parser_15-1.0.0-1PGSTY.el8.x86_64.rpm
pg_icu_parser_15 1.0.0 el8.aarch64 pigsty 28.4 KiB pg_icu_parser_15-1.0.0-1PGSTY.el8.aarch64.rpm
pg_icu_parser_15 1.0.0 el9.x86_64 pigsty 28.5 KiB pg_icu_parser_15-1.0.0-1PGSTY.el9.x86_64.rpm
pg_icu_parser_15 1.0.0 el9.aarch64 pigsty 28.6 KiB pg_icu_parser_15-1.0.0-1PGSTY.el9.aarch64.rpm
pg_icu_parser_15 1.0.0 el10.x86_64 pigsty 28.6 KiB pg_icu_parser_15-1.0.0-1PGSTY.el10.x86_64.rpm
pg_icu_parser_15 1.0.0 el10.aarch64 pigsty 28.8 KiB pg_icu_parser_15-1.0.0-1PGSTY.el10.aarch64.rpm
postgresql-15-pg-icu-parser 1.0.0 d12.x86_64 pigsty 20.0 KiB postgresql-15-pg-icu-parser_1.0.0-1PGSTY~bookworm_amd64.deb
postgresql-15-pg-icu-parser 1.0.0 d12.aarch64 pigsty 20.7 KiB postgresql-15-pg-icu-parser_1.0.0-1PGSTY~bookworm_arm64.deb
postgresql-15-pg-icu-parser 1.0.0 d13.x86_64 pigsty 20.0 KiB postgresql-15-pg-icu-parser_1.0.0-1PGSTY~trixie_amd64.deb
postgresql-15-pg-icu-parser 1.0.0 d13.aarch64 pigsty 19.9 KiB postgresql-15-pg-icu-parser_1.0.0-1PGSTY~trixie_arm64.deb
postgresql-15-pg-icu-parser 1.0.0 u22.x86_64 pigsty 21.5 KiB postgresql-15-pg-icu-parser_1.0.0-1PGSTY~jammy_amd64.deb
postgresql-15-pg-icu-parser 1.0.0 u22.aarch64 pigsty 21.6 KiB postgresql-15-pg-icu-parser_1.0.0-1PGSTY~jammy_arm64.deb
postgresql-15-pg-icu-parser 1.0.0 u24.x86_64 pigsty 21.1 KiB postgresql-15-pg-icu-parser_1.0.0-1PGSTY~noble_amd64.deb
postgresql-15-pg-icu-parser 1.0.0 u24.aarch64 pigsty 20.4 KiB postgresql-15-pg-icu-parser_1.0.0-1PGSTY~noble_arm64.deb
postgresql-15-pg-icu-parser 1.0.0 u26.x86_64 pigsty 20.7 KiB postgresql-15-pg-icu-parser_1.0.0-1PGSTY~resolute_amd64.deb
postgresql-15-pg-icu-parser 1.0.0 u26.aarch64 pigsty 20.9 KiB postgresql-15-pg-icu-parser_1.0.0-1PGSTY~resolute_arm64.deb
Package Version OS ORG SIZE File URL
pg_icu_parser_14 1.0.0 el8.x86_64 pigsty 28.1 KiB pg_icu_parser_14-1.0.0-1PGSTY.el8.x86_64.rpm
pg_icu_parser_14 1.0.0 el8.aarch64 pigsty 28.4 KiB pg_icu_parser_14-1.0.0-1PGSTY.el8.aarch64.rpm
pg_icu_parser_14 1.0.0 el9.x86_64 pigsty 28.5 KiB pg_icu_parser_14-1.0.0-1PGSTY.el9.x86_64.rpm
pg_icu_parser_14 1.0.0 el9.aarch64 pigsty 28.6 KiB pg_icu_parser_14-1.0.0-1PGSTY.el9.aarch64.rpm
pg_icu_parser_14 1.0.0 el10.x86_64 pigsty 28.5 KiB pg_icu_parser_14-1.0.0-1PGSTY.el10.x86_64.rpm
pg_icu_parser_14 1.0.0 el10.aarch64 pigsty 28.8 KiB pg_icu_parser_14-1.0.0-1PGSTY.el10.aarch64.rpm
postgresql-14-pg-icu-parser 1.0.0 d12.x86_64 pigsty 20.0 KiB postgresql-14-pg-icu-parser_1.0.0-1PGSTY~bookworm_amd64.deb
postgresql-14-pg-icu-parser 1.0.0 d12.aarch64 pigsty 19.8 KiB postgresql-14-pg-icu-parser_1.0.0-1PGSTY~bookworm_arm64.deb
postgresql-14-pg-icu-parser 1.0.0 d13.x86_64 pigsty 20.0 KiB postgresql-14-pg-icu-parser_1.0.0-1PGSTY~trixie_amd64.deb
postgresql-14-pg-icu-parser 1.0.0 d13.aarch64 pigsty 19.8 KiB postgresql-14-pg-icu-parser_1.0.0-1PGSTY~trixie_arm64.deb
postgresql-14-pg-icu-parser 1.0.0 u22.x86_64 pigsty 21.5 KiB postgresql-14-pg-icu-parser_1.0.0-1PGSTY~jammy_amd64.deb
postgresql-14-pg-icu-parser 1.0.0 u22.aarch64 pigsty 21.6 KiB postgresql-14-pg-icu-parser_1.0.0-1PGSTY~jammy_arm64.deb
postgresql-14-pg-icu-parser 1.0.0 u24.x86_64 pigsty 21.1 KiB postgresql-14-pg-icu-parser_1.0.0-1PGSTY~noble_amd64.deb
postgresql-14-pg-icu-parser 1.0.0 u24.aarch64 pigsty 20.4 KiB postgresql-14-pg-icu-parser_1.0.0-1PGSTY~noble_arm64.deb
postgresql-14-pg-icu-parser 1.0.0 u26.x86_64 pigsty 20.6 KiB postgresql-14-pg-icu-parser_1.0.0-1PGSTY~resolute_amd64.deb
postgresql-14-pg-icu-parser 1.0.0 u26.aarch64 pigsty 20.8 KiB postgresql-14-pg-icu-parser_1.0.0-1PGSTY~resolute_arm64.deb

Source

pig build pkg pg_icu_parser;		# 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 pg_icu_parser;		# install via package name, for the active PG version

pig install pg_icu_parser -v 18;   # install for PG 18
pig install pg_icu_parser -v 17;   # install for PG 17
pig install pg_icu_parser -v 16;   # install for PG 16
pig install pg_icu_parser -v 15;   # install for PG 15
pig install pg_icu_parser -v 14;   # install for PG 14

Create this extension with:

CREATE EXTENSION pg_icu_parser;

Usage

Sources:

pg_icu_parser supplies the icu_parser full-text-search parser, which uses ICU Unicode word-boundary analysis. It is useful for languages such as Chinese, Japanese, Korean, and Hebrew where PostgreSQL’s whitespace- and pattern-oriented default parser may not produce suitable word boundaries.

Core Workflow

The server must be PostgreSQL 10 or later and must have been built with ICU support. Create the extension, then create a text-search configuration that selects its parser and maps the token types you need:

CREATE EXTENSION pg_icu_parser;

CREATE TEXT SEARCH CONFIGURATION sample (PARSER = icu_parser);
ALTER TEXT SEARCH CONFIGURATION sample
  ADD MAPPING FOR word WITH english_stem;
ALTER TEXT SEARCH CONFIGURATION sample
  ADD MAPPING FOR number, ideo, kana WITH simple;

SELECT to_tsvector('sample', '東京でPostgreSQLを使う');

Choose dictionaries for the actual language; english_stem above only demonstrates the mapping syntax.

Parser Surface

  • word, number, kana, ideo, and blank are the token types emitted by icu_parser.
  • pg_icu_parser.locale selects the ICU locale and defaults to en. Upstream notes that word-boundary rules are usually not locale-sensitive, so change it only after testing a concrete need.
  • Any PostgreSQL text-search dictionary can be mapped to the emitted token types.

Trade-offs

  • The parser requires ICU in the PostgreSQL build; creating the extension cannot add ICU to a server built without it.
  • It emits fewer and coarser token types than the default parser and does not recognize special patterns such as URLs or email addresses as distinct categories.
  • The reviewed release does not support ts_headline.
  • Upstream reports that it is slower than the default parser, with a lower conversion overhead when the database encoding is UTF-8. Benchmark representative documents and query shapes on the target system.
  • When parser mappings or locale behavior change, rebuild stored tsvector values and dependent indexes so old and new rows do not use different tokenization.