uint128
Native uint128 type
pg_uint128 : Native uint128 type
Overview
| ID | Extension | Package | Version | Category | License | Language |
|---|---|---|---|---|---|---|
| 3740 | uint128 | pg_uint128 | 1.2.0 |
TYPE | PostgreSQL | C |
| Attribute | Has Binary | Has Library | Need Load | Has DDL | Relocatable | Trusted |
|---|---|---|---|---|---|---|
| --s-d-r | No | Yes | No | Yes | yes | no |
breaks on el8 since 1.1 ,fix el8 build problem by adding __has_builtin marco
Packages
| Type | Repo | Version | PG Major Compatibility | Package Pattern | Dependencies |
|---|---|---|---|---|---|
| EXT | PIGSTY | 1.2.0 |
18 17 16 15 14 | pg_uint128 |
- |
| RPM | PIGSTY | 1.2.0 |
18 17 16 15 14 | pg_uint128_$v |
- |
| DEB | PIGSTY | 1.2.0 |
18 17 16 15 14 | postgresql-$v-pg-uint128 |
- |
| Linux / PG | PG18 | PG17 | PG16 | PG15 | PG14 |
|---|---|---|---|---|---|
| el8.x86_64 | PIGSTY 1.2.0 | PIGSTY 1.2.0 | PIGSTY 1.2.0 | PIGSTY 1.2.0 | PIGSTY 1.2.0 |
| el8.aarch64 | PIGSTY 1.2.0 | PIGSTY 1.2.0 | PIGSTY 1.2.0 | PIGSTY 1.2.0 | PIGSTY 1.2.0 |
| el9.x86_64 | PIGSTY 1.2.0 | PIGSTY 1.2.0 | PIGSTY 1.2.0 | PIGSTY 1.2.0 | PIGSTY 1.2.0 |
| el9.aarch64 | PIGSTY 1.2.0 | PIGSTY 1.2.0 | PIGSTY 1.2.0 | PIGSTY 1.2.0 | PIGSTY 1.2.0 |
| el10.x86_64 | PIGSTY 1.2.0 | PIGSTY 1.2.0 | PIGSTY 1.2.0 | PIGSTY 1.2.0 | PIGSTY 1.2.0 |
| el10.aarch64 | PIGSTY 1.2.0 | PIGSTY 1.2.0 | PIGSTY 1.2.0 | PIGSTY 1.2.0 | PIGSTY 1.2.0 |
| d12.x86_64 | PIGSTY 1.2.0 | PIGSTY 1.2.0 | PIGSTY 1.2.0 | PIGSTY 1.2.0 | PIGSTY 1.2.0 |
| d12.aarch64 | PIGSTY 1.2.0 | PIGSTY 1.2.0 | PIGSTY 1.2.0 | PIGSTY 1.2.0 | PIGSTY 1.2.0 |
| d13.x86_64 | PIGSTY 1.2.0 | PIGSTY 1.2.0 | PIGSTY 1.2.0 | PIGSTY 1.2.0 | PIGSTY 1.2.0 |
| d13.aarch64 | PIGSTY 1.2.0 | PIGSTY 1.2.0 | PIGSTY 1.2.0 | PIGSTY 1.2.0 | PIGSTY 1.2.0 |
| u22.x86_64 | PIGSTY 1.2.0 | PIGSTY 1.2.0 | PIGSTY 1.2.0 | PIGSTY 1.2.0 | PIGSTY 1.2.0 |
| u22.aarch64 | PIGSTY 1.2.0 | PIGSTY 1.2.0 | PIGSTY 1.2.0 | PIGSTY 1.2.0 | PIGSTY 1.2.0 |
| u24.x86_64 | PIGSTY 1.2.0 | PIGSTY 1.2.0 | PIGSTY 1.2.0 | PIGSTY 1.2.0 | PIGSTY 1.2.0 |
| u24.aarch64 | PIGSTY 1.2.0 | PIGSTY 1.2.0 | PIGSTY 1.2.0 | PIGSTY 1.2.0 | PIGSTY 1.2.0 |
| u26.x86_64 | PIGSTY 1.2.0 | PIGSTY 1.2.0 | PIGSTY 1.2.0 | PIGSTY 1.2.0 | PIGSTY 1.2.0 |
| u26.aarch64 | PIGSTY 1.2.0 | PIGSTY 1.2.0 | PIGSTY 1.2.0 | PIGSTY 1.2.0 | PIGSTY 1.2.0 |
Source
github.com/pg-uint/pg-uint128
pg-uint128-1.2.0.tar.gz
Install
Make sure PGDG and PIGSTY repo available:
Install this extension with pig:
Create this extension with:
Usage
The uint128 extension provides comprehensive unsigned and 128-bit integer types with full operator and index support.
Data Types
| Type | Size | Range |
|---|---|---|
uint1 |
8-bit | 0 to 255 |
uint2 |
16-bit | 0 to 65535 |
uint4 |
32-bit | 0 to 4294967295 |
uint8 |
64-bit | 0 to 18446744073709551615 |
uint16 |
128-bit | 0 to 340282366920938463463374607431768211455 |
int1 |
8-bit | -128 to 127 |
int16 |
128-bit | -170141183460469231731687303715884105728 to 170141183460469231731687303715884105727 |
Operators
- Arithmetic:
+,-,*,/,% - Bitwise:
#(XOR),&(AND),|(OR),~(NOT),<<(left shift),>>(right shift) - Comparison:
=,<>,>,<,>=,<=
Mixed-type arithmetic between signed and unsigned types is supported.
Features
- Range types for all integer types (
uint1range,uint16range, etc.) with GiST indexing - Casts to/from
numeric,real,double,uuid(uint16 only),json,jsonb - Aggregate functions:
SUM,AVG,MIN,MAX generate_series()support for all types- Btree and hash index support
- Binary send/receive protocol support