numeral

numeral datatypes extension

Overview

PackageVersionCategoryLicenseLanguage
numeral1.3TYPEGPL-2.0C
IDExtensionBinLibLoadCreateTrustRelocSchema
3710numeralNoYesNoYesNoYes-
Relatedcurrency pgmp unit prefix semver pgpdf pglite_fusion md5hash

Version

TypeRepoVersionPG VerPackageDeps
EXTMIXED1.31817161514numeral-
RPMPIGSTY1.31817161514numeral_$v-
DEBPGDG1.31817161514postgresql-$v-numeral-
OS / PGPG18PG17PG16PG15PG14
el8.x86_64
el8.aarch64
el9.x86_64
el9.aarch64
el10.x86_64
el10.aarch64
d12.x86_64
PGDG 1.3
PGDG 1.3
PGDG 1.3
PGDG 1.3
PGDG 1.3
d12.aarch64
PGDG 1.3
PGDG 1.3
PGDG 1.3
PGDG 1.3
PGDG 1.3
d13.x86_64
PGDG 1.3
PGDG 1.3
PGDG 1.3
PGDG 1.3
PGDG 1.3
d13.aarch64
PGDG 1.3
PGDG 1.3
PGDG 1.3
PGDG 1.3
PGDG 1.3
u22.x86_64
PGDG 1.3
PGDG 1.3
PGDG 1.3
PGDG 1.3
PGDG 1.3
u22.aarch64
PGDG 1.3
PGDG 1.3
PGDG 1.3
PGDG 1.3
PGDG 1.3
u24.x86_64
PGDG 1.3
PGDG 1.3
PGDG 1.3
PGDG 1.3
PGDG 1.3
u24.aarch64
PGDG 1.3
PGDG 1.3
PGDG 1.3
PGDG 1.3
PGDG 1.3

Build

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

pig build pkg numeral         # build RPM packages

Install

You can install numeral 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 numeral;          # Install for current active PG version
pig ext install -y numeral -v 18  # PG 18
pig ext install -y numeral -v 17  # PG 17
pig ext install -y numeral -v 16  # PG 16
pig ext install -y numeral -v 15  # PG 15
pig ext install -y numeral -v 14  # PG 14
dnf install -y numeral_18       # PG 18
dnf install -y numeral_17       # PG 17
dnf install -y numeral_16       # PG 16
dnf install -y numeral_15       # PG 15
dnf install -y numeral_14       # PG 14
apt install -y postgresql-18-numeral   # PG 18
apt install -y postgresql-17-numeral   # PG 17
apt install -y postgresql-16-numeral   # PG 16
apt install -y postgresql-15-numeral   # PG 15
apt install -y postgresql-14-numeral   # PG 14

Create Extension:

CREATE EXTENSION numeral;

Usage

numeral: text numeral data types (English, German, Roman)

The numeral extension provides three custom numeric data types that use textual numerals instead of digits.

CREATE EXTENSION numeral;

Data Types

  • numeral: English numerals using short scale (10^9 = billion)
  • zahl: German numerals using long scale (10^9 = Milliarde)
  • roman: Roman numerals

All three are internally binary-compatible with bigint and implicitly cast to it.

Examples

-- English numerals
SELECT 'thirty'::numeral + 'twelve'::numeral;
-- forty-two

-- German numerals
SELECT 'siebzehn'::zahl * 'dreiundzwanzig'::zahl;
-- dreihunderteinundneunzig

-- Roman numerals
SELECT 'MCMLV'::roman + 'II'::roman * 'XXX'::roman;
-- MMXV

Operators

Standard arithmetic operators (+, -, *, /) work through the implicit bigint cast. All existing bigint operators and functions are available.


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