Skip to content
numeral

numeral

numeral : numeral datatypes extension

Overview

IDExtensionPackageVersionCategoryLicenseLanguage
3710
numeral
numeral
1.3
TYPE
GPL-2.0
C
AttributeHas BinaryHas LibraryNeed LoadHas DDLRelocatableTrusted
--s-d-r
No
Yes
No
Yes
yes
no
Relationships
See Also
currency
pgmp
unit
prefix
semver
pgpdf
pglite_fusion
md5hash

Packages

TypeRepoVersionPG Major CompatibilityPackage PatternDependencies
EXT
MIXED
1.3
18
17
16
15
14
numeral-
RPM
PIGSTY
1.3
18
17
16
15
14
numeral_$v-
DEB
PGDG
1.3
18
17
16
15
14
postgresql-$v-numeral-
Linux / PGPG18PG17PG16PG15PG14
el8.x86_64
PIGSTY 1.3
PIGSTY 1.3
PIGSTY 1.3
PIGSTY 1.3
PIGSTY 1.3
el8.aarch64
PIGSTY 1.3
PIGSTY 1.3
PIGSTY 1.3
PIGSTY 1.3
PIGSTY 1.3
el9.x86_64
PIGSTY 1.3
PIGSTY 1.3
PIGSTY 1.3
PIGSTY 1.3
PIGSTY 1.3
el9.aarch64
PIGSTY 1.3
PIGSTY 1.3
PIGSTY 1.3
PIGSTY 1.3
PIGSTY 1.3
el10.x86_64
PIGSTY 1.3
PIGSTY 1.3
PIGSTY 1.3
PIGSTY 1.3
PIGSTY 1.3
el10.aarch64
PIGSTY 1.3
PIGSTY 1.3
PIGSTY 1.3
PIGSTY 1.3
PIGSTY 1.3
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
u26.x86_64
PGDG 1.3
PGDG 1.3
PGDG 1.3
PGDG 1.3
PGDG 1.3
u26.aarch64
PGDG 1.3
PGDG 1.3
PGDG 1.3
PGDG 1.3
PGDG 1.3
PackageVersionOSORGSIZEFile URL
numeral_181.3el8.x86_64pigsty33.1 KiBnumeral_18-1.3-1PIGSTY.el8.x86_64.rpm
numeral_181.3el8.aarch64pigsty32.2 KiBnumeral_18-1.3-1PIGSTY.el8.aarch64.rpm
numeral_181.3el9.x86_64pigsty31.4 KiBnumeral_18-1.3-1PIGSTY.el9.x86_64.rpm
numeral_181.3el9.aarch64pigsty32.0 KiBnumeral_18-1.3-1PIGSTY.el9.aarch64.rpm
numeral_181.3el10.x86_64pigsty32.5 KiBnumeral_18-1.3-1PIGSTY.el10.x86_64.rpm
numeral_181.3el10.aarch64pigsty32.5 KiBnumeral_18-1.3-1PIGSTY.el10.aarch64.rpm
postgresql-18-numeral1.3d12.x86_64pgdg74.1 KiBpostgresql-18-numeral_1.3-9.pgdg12+1_amd64.deb
postgresql-18-numeral1.3d12.x86_64pgdg74.1 KiBpostgresql-18-numeral_1.3-8.pgdg12+1_amd64.deb
postgresql-18-numeral1.3d12.aarch64pgdg72.0 KiBpostgresql-18-numeral_1.3-9.pgdg12+1_arm64.deb
postgresql-18-numeral1.3d12.aarch64pgdg72.2 KiBpostgresql-18-numeral_1.3-8.pgdg12+1_arm64.deb
postgresql-18-numeral1.3d13.x86_64pgdg74.9 KiBpostgresql-18-numeral_1.3-9.pgdg13+1_amd64.deb
postgresql-18-numeral1.3d13.x86_64pgdg75.0 KiBpostgresql-18-numeral_1.3-8.pgdg13+1_amd64.deb
postgresql-18-numeral1.3d13.aarch64pgdg73.3 KiBpostgresql-18-numeral_1.3-9.pgdg13+1_arm64.deb
postgresql-18-numeral1.3d13.aarch64pgdg73.3 KiBpostgresql-18-numeral_1.3-8.pgdg13+1_arm64.deb
postgresql-18-numeral1.3u22.x86_64pgdg74.4 KiBpostgresql-18-numeral_1.3-9.pgdg22.04+1_amd64.deb
postgresql-18-numeral1.3u22.x86_64pgdg74.5 KiBpostgresql-18-numeral_1.3-8.pgdg22.04+1_amd64.deb
postgresql-18-numeral1.3u22.aarch64pgdg74.1 KiBpostgresql-18-numeral_1.3-9.pgdg22.04+1_arm64.deb
postgresql-18-numeral1.3u22.aarch64pgdg74.1 KiBpostgresql-18-numeral_1.3-8.pgdg22.04+1_arm64.deb
postgresql-18-numeral1.3u24.x86_64pgdg73.8 KiBpostgresql-18-numeral_1.3-9.pgdg24.04+1_amd64.deb
postgresql-18-numeral1.3u24.x86_64pgdg73.8 KiBpostgresql-18-numeral_1.3-8.pgdg24.04+1_amd64.deb
postgresql-18-numeral1.3u24.aarch64pgdg73.2 KiBpostgresql-18-numeral_1.3-9.pgdg24.04+1_arm64.deb
postgresql-18-numeral1.3u24.aarch64pgdg73.2 KiBpostgresql-18-numeral_1.3-8.pgdg24.04+1_arm64.deb
postgresql-18-numeral1.3u26.x86_64pgdg73.3 KiBpostgresql-18-numeral_1.3-9.pgdg26.04+1_amd64.deb
postgresql-18-numeral1.3u26.x86_64pgdg73.7 KiBpostgresql-18-numeral_1.3-8.pgdg26.04+1_amd64.deb
postgresql-18-numeral1.3u26.aarch64pgdg72.4 KiBpostgresql-18-numeral_1.3-9.pgdg26.04+1_arm64.deb
postgresql-18-numeral1.3u26.aarch64pgdg72.8 KiBpostgresql-18-numeral_1.3-8.pgdg26.04+1_arm64.deb

Source

pig build pkg numeral;		# build rpm

Install

Make sure PGDG and PIGSTY repo available:

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

Install this extension with pig:

pig install numeral;		# install via package name, for the active PG version

pig install numeral -v 18;   # install for PG 18
pig install numeral -v 17;   # install for PG 17
pig install numeral -v 16;   # install for PG 16
pig install numeral -v 15;   # install for PG 15
pig install numeral -v 14;   # install for PG 14

Create this extension with:

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 updated on