uint128
pg_uint128 : Native uint128 type
Overview
| ID | Extension | Package | Version | Category | License | Language |
|---|---|---|---|---|---|---|
| 3760 | uint128 | pg_uint128 | 1.3.0 |
TYPE | PostgreSQL | C |
| Attribute | Has Binary | Has Library | Need Load | Has DDL | Relocatable | Trusted |
|---|---|---|---|---|---|---|
| --s-d-r | No | Yes | No | Yes | yes | no |
Packages
| Linux / PG | PG19 | PG18 | PG17 | PG16 | PG15 |
|---|---|---|---|---|---|
| el8.x86_64 | N/A | PIGSTY 1.3.0 | PIGSTY 1.3.0 | PIGSTY 1.3.0 | PIGSTY 1.3.0 |
| el8.aarch64 | N/A | PIGSTY 1.3.0 | PIGSTY 1.3.0 | PIGSTY 1.3.0 | PIGSTY 1.3.0 |
| el9.x86_64 | PIGSTY 1.3.0 | PIGSTY 1.3.0 | PIGSTY 1.3.0 | PIGSTY 1.3.0 | PIGSTY 1.3.0 |
| el9.aarch64 | PIGSTY 1.3.0 | PIGSTY 1.3.0 | PIGSTY 1.3.0 | PIGSTY 1.3.0 | PIGSTY 1.3.0 |
| el10.x86_64 | PIGSTY 1.3.0 | PIGSTY 1.3.0 | PIGSTY 1.3.0 | PIGSTY 1.3.0 | PIGSTY 1.3.0 |
| el10.aarch64 | PIGSTY 1.3.0 | PIGSTY 1.3.0 | PIGSTY 1.3.0 | PIGSTY 1.3.0 | PIGSTY 1.3.0 |
| d12.x86_64 | PIGSTY 1.3.0 | PIGSTY 1.3.0 | PIGSTY 1.3.0 | PIGSTY 1.3.0 | PIGSTY 1.3.0 |
| d12.aarch64 | PIGSTY 1.3.0 | PIGSTY 1.3.0 | PIGSTY 1.3.0 | PIGSTY 1.3.0 | PIGSTY 1.3.0 |
| d13.x86_64 | PIGSTY 1.3.0 | PIGSTY 1.3.0 | PIGSTY 1.3.0 | PIGSTY 1.3.0 | PIGSTY 1.3.0 |
| d13.aarch64 | PIGSTY 1.3.0 | PIGSTY 1.3.0 | PIGSTY 1.3.0 | PIGSTY 1.3.0 | PIGSTY 1.3.0 |
| u22.x86_64 | PIGSTY 1.3.0 | PIGSTY 1.3.0 | PIGSTY 1.3.0 | PIGSTY 1.3.0 | PIGSTY 1.3.0 |
| u22.aarch64 | PIGSTY 1.3.0 | PIGSTY 1.3.0 | PIGSTY 1.3.0 | PIGSTY 1.3.0 | PIGSTY 1.3.0 |
| u24.x86_64 | PIGSTY 1.3.0 | PIGSTY 1.3.0 | PIGSTY 1.3.0 | PIGSTY 1.3.0 | PIGSTY 1.3.0 |
| u24.aarch64 | PIGSTY 1.3.0 | PIGSTY 1.3.0 | PIGSTY 1.3.0 | PIGSTY 1.3.0 | PIGSTY 1.3.0 |
| u26.x86_64 | PIGSTY 1.3.0 | PIGSTY 1.3.0 | PIGSTY 1.3.0 | PIGSTY 1.3.0 | PIGSTY 1.3.0 |
| u26.aarch64 | PIGSTY 1.3.0 | PIGSTY 1.3.0 | PIGSTY 1.3.0 | PIGSTY 1.3.0 | PIGSTY 1.3.0 |
Source
github.com/pg-uint/pg-uint128
pg-uint128-1.3.0.tar.gz
Install
Make sure PGDG and PIGSTY repo available:
Install this extension with pig:
Create this extension with:
Usage
Sources:
uint128 adds unsigned integers and signed 8-bit and 128-bit integer types. Version 1.3.0 supports PostgreSQL 12–18 and fixes operator metadata that could make indexed comparisons return incorrect results.
Store and Query Integers
Installation requires a superuser; the control file does not mark the extension trusted. It is relocatable and requires no preload.
The unsigned types uint1, uint2, uint4, uint8 and uint16 occupy 1, 2, 4, 8 and 16 bytes. Their range is zero through 2 raised to the bit width minus one. int1 and int16 are signed 1-byte and 16-byte types.
Operators and Indexes
The types provide arithmetic, comparisons, bitwise operations, B-tree and hash indexes, binary I/O, casts and generate_series. Corresponding range types, including uint1range and uint16range, support GiST indexes; multiranges depend on server support. SUM and AVG use numeric internally; MIN and MAX are also available.
Mixed signed/unsigned arithmetic is sensitive to operand order and result type. Cast explicitly when a negative result is possible: an unsigned result cannot represent it. Conversions and arithmetic may raise range errors; do not assume wraparound.
Upgrade to 1.3.0
Install the matching files, then run as a superuser:
This corrects comparison commutators and removes invalid mixed-type addition/subtraction commutators. It also fixes installation with the stricter operator checks in PostgreSQL 17.12. The supplied SQL updates operator metadata in place while preserving data, indexes, views and materialized views. Check the installed version and representative indexed comparisons after upgrading.