icu_ext

Access ICU functions

Overview

PackageVersionCategoryLicenseLanguage
icu_ext1.10.0UTILPostgreSQLC
IDExtensionBinLibLoadCreateTrustRelocSchema
4240icu_extNoYesNoYesNoYes-
Relatedpgpcre pg_xenophile unaccent gzip bzip zstd http pg_net

Version

TypeRepoVersionPG VerPackageDeps
EXTMIXED1.10.01817161514icu_ext-
RPMPIGSTY1.10.01817161514icu_ext_$v-
DEBPGDG1.10.01817161514postgresql-$v-icu-ext-
OS / PGPG18PG17PG16PG15PG14
el8.x86_64
el8.aarch64
el9.x86_64
el9.aarch64
el10.x86_64
el10.aarch64
d12.x86_64
PGDG 1.10.0
PGDG 1.10.0
PGDG 1.10.0
PGDG 1.10.0
PGDG 1.10.0
d12.aarch64
PGDG 1.10.0
PGDG 1.10.0
PGDG 1.10.0
PGDG 1.10.0
PGDG 1.10.0
d13.x86_64
PGDG 1.10.0
PGDG 1.10.0
PGDG 1.10.0
PGDG 1.10.0
PGDG 1.10.0
d13.aarch64
PGDG 1.10.0
PGDG 1.10.0
PGDG 1.10.0
PGDG 1.10.0
PGDG 1.10.0
u22.x86_64
u22.aarch64
PGDG 1.10.0
u24.x86_64
u24.aarch64
PGDG 1.10.0
PGDG 1.10.0
PGDG 1.10.0
PGDG 1.10.0
PGDG 1.10.0

Build

You can build the RPM packages for icu_ext using pig build:

pig build pkg icu_ext         # build RPM packages

Install

You can install icu_ext directly. First, make sure the PGDG and PIGSTY repositories are added and enabled:

pig repo add pgsql -u          # Add repo and update cache

Install the extension using pig or apt/yum/dnf:

pig install icu_ext;          # Install for current active PG version
pig ext install -y icu_ext -v 18  # PG 18
pig ext install -y icu_ext -v 17  # PG 17
pig ext install -y icu_ext -v 16  # PG 16
pig ext install -y icu_ext -v 15  # PG 15
pig ext install -y icu_ext -v 14  # PG 14
dnf install -y icu_ext_18       # PG 18
dnf install -y icu_ext_17       # PG 17
dnf install -y icu_ext_16       # PG 16
dnf install -y icu_ext_15       # PG 15
dnf install -y icu_ext_14       # PG 14
apt install -y postgresql-18-icu-ext   # PG 18
apt install -y postgresql-17-icu-ext   # PG 17
apt install -y postgresql-16-icu-ext   # PG 16
apt install -y postgresql-15-icu-ext   # PG 15
apt install -y postgresql-14-icu-ext   # PG 14

Create Extension:

CREATE EXTENSION icu_ext;

Usage

icu_ext: ICU extension functions for PostgreSQL

Exposes ICU functionality to PostgreSQL. Requires PostgreSQL 11+ configured with ICU (--with-icu).

Version Info

SELECT icu_version();           -- ICU library version
SELECT icu_unicode_version();   -- Unicode standard version

Locale Functions

SELECT * FROM icu_locales_list() WHERE name LIKE 'es%' LIMIT 5;
SELECT icu_default_locale();
SELECT icu_set_default_locale('en');

Collation Attributes

SELECT * FROM icu_collation_attributes('fr-u-ks-level2-kn');

String Comparison

-- Case-sensitive, accent-insensitive comparison:
SELECT icu_compare('abce', 'abce', 'en-u-ks-level1-kc-true');  -- 0
SELECT icu_compare('Abce', 'abce', 'en-u-ks-level1-kc-true');  -- 1

Sort Keys (for unique indexes)

CREATE UNIQUE INDEX idx ON my_table((icu_sort_key(name, 'fr-u-ks-level1')));

Text Boundary Analysis

SELECT * FROM icu_character_boundaries('Hello', 'en');
SELECT * FROM icu_word_boundaries('I like books', 'en');
SELECT * FROM icu_sentence_boundaries('Mr. Smith went home. He was tired.', 'en');
SELECT * FROM icu_line_boundaries('Long text here', 'en');

Unicode Normalization and Transformation

SELECT icu_normalize('text', 'NFC');
SELECT icu_is_normalized('text', 'NFC');
SELECT icu_transform('Hello', 'Latin-Cyrillic');
SELECT * FROM icu_transforms_list();

Number Spellout

SELECT icu_number_spellout(42, 'en');   -- 'forty-two'
SELECT icu_number_spellout(42, 'fr');   -- 'quarante-deux'

Spoof and Confusable Detection

SELECT icu_spoof_check('paypal');
SELECT icu_confusable_strings_check('google', 'gооgle');

Character Info

SELECT icu_char_name('A');
SELECT icu_char_type('A');

Last Modified 2026-03-12: add pg extension catalog (95749bf)