Skip to content

language

Custom PostgreSQL language enumeration type

pg_language · Custom PostgreSQL language enumeration type

Overview

IDExtensionPackageVersionCategoryLicenseLanguage
100234languagepg_language0.0.4TYPEPostgreSQLC

PostgreSQL · 10, 11, 12, 13, 14, 15, 16, 17, 18

Usage

Sources:

language defines a compact, one-byte, application-specific language type. Its accepted values are generated from the upstream languages mapping rather than from PostgreSQL procedural-language catalog entries.

CREATE EXTENSION language;
SELECT supported_languages();
CREATE TABLE profile (
  profile_id bigint PRIMARY KEY,
  preferred_language language NOT NULL
);

The extension supplies text/binary I/O, comparison operators, and default B-tree and hash operator classes, so values can be sorted, indexed, and compared. Use supported_languages() to discover the exact mapping shipped by the installed build instead of assuming ISO code coverage.

The internal representation is a generated one-byte code. Changing or regenerating the mapping can reinterpret stored bytes, which makes binary compatibility and logical meaning dependent on the exact build. Pin the source revision across every node, verify dump/restore and replication behavior before upgrades, and do not use the type as a general standards registry without auditing the mapping.

Table reader