uint128
Native uint128 type
Repository
pg-uint/pg-uint128
https://github.com/pg-uint/pg-uint128
Source
pg-uint128-1.2.0.tar.gz
pg-uint128-1.2.0.tar.gz
Overview
| Package | Version | Category | License | Language |
|---|---|---|---|---|
pg_uint128 | 1.2.0 | TYPE | PostgreSQL | C |
| ID | Extension | Bin | Lib | Load | Create | Trust | Reloc | Schema |
|---|---|---|---|---|---|---|---|---|
| 3740 | uint128 | No | Yes | No | Yes | No | Yes | - |
breaks on el8 since 1.1 ,fix el8 build problem by adding __has_builtin marco
Version
| Type | Repo | Version | PG Ver | Package | Deps |
|---|---|---|---|---|---|
| EXT | PIGSTY | 1.2.0 | 1817161514 | pg_uint128 | - |
| RPM | PIGSTY | 1.2.0 | 1817161514 | pg_uint128_$v | - |
| DEB | PIGSTY | 1.2.0 | 1817161514 | postgresql-$v-pg-uint128 | - |
Build
You can build the RPM / DEB packages for pg_uint128 using pig build:
Install
You can install pg_uint128 directly. First, make sure the PGDG and PIGSTY repositories are added and enabled:
Install the extension using pig or apt/yum/dnf:
Install
pig
dnf
apt
Create Extension:
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
Was this page helpful?
Thanks—your feedback helps us improve this page.
What got in the way? (optional)