Skip to content

pg_punycode

Punycode and IDNA/UTS-46 domain-name conversion functions.

pg_punycode · Punycode and IDNA/UTS-46 domain-name conversion functions.

Overview

IDExtensionPackageVersionCategoryLicenseLanguage
101924pg_punycodepg_punycode0.1.0UTILMITRust

PostgreSQL · 13, 14, 15, 16, 17, 18

Usage

Sources:

pg_punycode Punycode and IDNA/UTS-46 domain-name conversion functions.

Enablement

Install the files for the intended server, then create pg_punycode in the target database:

CREATE EXTENSION pg_punycode;

Core Workflow

The following example is taken from the reviewed upstream documentation. Adapt object names, paths, credentials, and workload values before use.

CREATE EXTENSION pg_punycode;

SELECT domain_to_ascii('Bücher.DE');                  -- xn--bcher-kva.de
SELECT domain_to_unicode('xn--fiqs8s');               -- 中国
SELECT punycode_encode('bücher');                     -- bcher-kva
SELECT punycode_decode('MajiKoi5-783gue6qz075azm5e'); -- MajiでKoiする5秒前

Main Objects

The reviewed install surface includes these prominent objects:

ObjectKindOperational role
domain_to_asciiFUNCTIONCallable function from the reviewed install surface.
punycode_encodeFUNCTIONCallable function from the reviewed install surface.
domain_to_unicodeFUNCTIONCallable function from the reviewed install surface.
punycode_decodeFUNCTIONCallable function from the reviewed install surface.

Operations and Boundaries

  • The verified PostgreSQL-major evidence covers 13, 14, 15, 16, 17, 18, 19; do not infer unlisted majors.
  • Catalog lifecycle is preview; test upgrades, dump/restore, and server compatibility before production use.

Table reader