numeral
numeral datatypes extension
Repository
df7cb/postgresql-numeral
https://github.com/df7cb/postgresql-numeral
Source
postgresql-numeral-1.3.tar.gz
postgresql-numeral-1.3.tar.gz
Overview
| Package | Version | Category | License | Language |
|---|---|---|---|---|
numeral | 1.3 | TYPE | GPL-2.0 | C |
| ID | Extension | Bin | Lib | Load | Create | Trust | Reloc | Schema |
|---|---|---|---|---|---|---|---|---|
| 3710 | numeral | No | Yes | No | Yes | No | Yes | - |
| Related | currency pgmp unit prefix semver pgpdf pglite_fusion md5hash |
|---|
Version
| Type | Repo | Version | PG Ver | Package | Deps |
|---|---|---|---|---|---|
| EXT | MIXED | 1.3 | 1817161514 | numeral | - |
| RPM | PIGSTY | 1.3 | 1817161514 | numeral_$v | - |
| DEB | PGDG | 1.3 | 1817161514 | postgresql-$v-numeral | - |
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
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.
Feedback
Was this page helpful?
Thanks for the feedback! Please let us know how we can improve.
Sorry to hear that. Please let us know how we can improve.