pg_xenophile

More than the bare necessities for PostgreSQL i18n and l10n.

Overview

PackageVersionCategoryLicenseLanguage
pg_xenophile0.8.3TYPEPostgreSQLSQL
IDExtensionBinLibLoadCreateTrustRelocSchema
3610pg_xenophileNoNoNoYesNoNoxeno
3611l10n_table_dependent_extensionNoNoNoYesYesYes-
Relatedcountry currency icu_ext prefix semver unit pgpdf pglite_fusion
Depended Byl10n_table_dependent_extension

Version

TypeRepoVersionPG VerPackageDeps
EXTPIGSTY0.8.31817161514pg_xenophile-
RPMPIGSTY0.8.31817161514pg_xenophile_$v-
DEBPIGSTY0.8.31817161514postgresql-$v-pg-xenophile-
OS / PGPG18PG17PG16PG15PG14
el8.x86_64
el8.aarch64
el9.x86_64
el9.aarch64
el10.x86_64
el10.aarch64
d12.x86_64
d12.aarch64
PIGSTY 0.8.3
PIGSTY 0.8.3
PIGSTY 0.8.3
PIGSTY 0.8.3
PIGSTY 0.8.3
d13.x86_64
PIGSTY 0.8.3
PIGSTY 0.8.3
PIGSTY 0.8.3
PIGSTY 0.8.3
PIGSTY 0.8.3
d13.aarch64
PIGSTY 0.8.3
PIGSTY 0.8.3
PIGSTY 0.8.3
PIGSTY 0.8.3
PIGSTY 0.8.3
u22.x86_64
PIGSTY 0.8.3
PIGSTY 0.8.3
PIGSTY 0.8.3
PIGSTY 0.8.3
PIGSTY 0.8.3
u22.aarch64
PIGSTY 0.8.3
PIGSTY 0.8.3
PIGSTY 0.8.3
PIGSTY 0.8.3
PIGSTY 0.8.3
u24.x86_64
PIGSTY 0.8.3
PIGSTY 0.8.3
PIGSTY 0.8.3
PIGSTY 0.8.3
PIGSTY 0.8.3
u24.aarch64
PIGSTY 0.8.3
PIGSTY 0.8.3
PIGSTY 0.8.3
PIGSTY 0.8.3
PIGSTY 0.8.3

Build

You can build the RPM / DEB packages for pg_xenophile using pig build:

pig build pkg pg_xenophile         # build RPM / DEB packages

Install

You can install pg_xenophile 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 pg_xenophile;          # Install for current active PG version
pig ext install -y pg_xenophile -v 18  # PG 18
pig ext install -y pg_xenophile -v 17  # PG 17
pig ext install -y pg_xenophile -v 16  # PG 16
pig ext install -y pg_xenophile -v 15  # PG 15
pig ext install -y pg_xenophile -v 14  # PG 14
dnf install -y pg_xenophile_18       # PG 18
dnf install -y pg_xenophile_17       # PG 17
dnf install -y pg_xenophile_16       # PG 16
dnf install -y pg_xenophile_15       # PG 15
dnf install -y pg_xenophile_14       # PG 14
apt install -y postgresql-18-pg-xenophile   # PG 18
apt install -y postgresql-17-pg-xenophile   # PG 17
apt install -y postgresql-16-pg-xenophile   # PG 16
apt install -y postgresql-15-pg-xenophile   # PG 15
apt install -y postgresql-14-pg-xenophile   # PG 14

Create Extension:

CREATE EXTENSION pg_xenophile;

Usage

pg_xenophile: internationalization (i18n) and localization (l10n) utilities

The pg_xenophile extension provides i18n/l10n infrastructure including reference data for countries, languages, and currencies, plus automated localization table management.

CREATE EXTENSION pg_xenophile CASCADE;

All objects reside in the xeno schema (non-relocatable).

Reference Tables

  • xeno.country: ISO 3166-1 codes with calling codes and currencies
  • xeno.lang: ISO 639-1 language codes
  • xeno.currency: ISO 4217 currency codes with symbols
  • xeno.country_subdivision: ISO 3166-2 subdivision codes
  • xeno.eu_country: EU membership tracking
  • xeno.country_postal_code_pattern: Postal code validation patterns

Localization Tables

The extension auto-manages translation tables. Insert into xeno.l10n_table to register a translatable base table:

INSERT INTO xeno.l10n_table (base_table_schema, base_table_name)
VALUES ('public', 'products');

This automatically creates a companion products_l10n table and language-specific views.

Convenience Views

  • xeno.country_l10n_en: Country names in English
  • xeno.lang_l10n_en: Language names in English
  • xeno.country_subdivision_l10n_en: Subdivision names in English

Configuration

SET pg_xenophile.base_lang_code = 'en';
SET pg_xenophile.user_lang_code = 'en';
SET pg_xenophile.target_lang_codes = '{nl,fr,de}';

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