uint
无符号整型数据类型
概览
| 扩展包名 | 版本 | 分类 | 许可证 | 语言 |
|---|---|---|---|---|
pguint | 1.20250815 | TYPE | PostgreSQL | C |
| ID | 扩展名 | Bin | Lib | Load | Create | Trust | Reloc | 模式 |
|---|---|---|---|---|---|---|---|---|
| 3730 | uint | 否 | 是 | 否 | 是 | 否 | 是 | - |
| 相关扩展 | prefix semver unit pgpdf pglite_fusion md5hash asn1oid roaringbitmap |
|---|
no pg14 for el8/el9 pgdg repo
版本
| 类型 | 仓库 | 版本 | PG 大版本 | 包名 | 依赖 |
|---|---|---|---|---|---|
| EXT | MIXED | 1.20250815 | 1817161514 | pguint | - |
| RPM | PIGSTY | 1.20250815 | 1817161514 | pguint_$v | - |
| DEB | PIGSTY | 1.20250815 | 1817161514 | postgresql-$v-pguint | - |
| OS / PG | PG18 | PG17 | PG16 | PG15 | PG14 |
|---|---|---|---|---|---|
| el8.x86_64 | PIGSTY 1.20250815 el8.x86_64.pg18 : pguint_18 pguint_18-1.20250815-1PIGSTY.el8.x86_64.rpm
pguint_18-1.20250815-1PGDG.rhel8.x86_64.rpm
| PIGSTY 1.20250815 | PIGSTY 1.20250815 | PIGSTY 1.20250815 | PIGSTY 1.20250815 el8.x86_64.pg14 : pguint_14 pguint_14-1.20250815-1PIGSTY.el8.x86_64.rpm
|
| el8.aarch64 | PIGSTY 1.20250815 el8.aarch64.pg18 : pguint_18 pguint_18-1.20250815-1PIGSTY.el8.aarch64.rpm
pguint_18-1.20250815-1PGDG.rhel8.aarch64.rpm
| PIGSTY 1.20250815 | PIGSTY 1.20250815 | PIGSTY 1.20250815 | PIGSTY 1.20250815 el8.aarch64.pg14 : pguint_14 pguint_14-1.20250815-1PIGSTY.el8.aarch64.rpm
|
| el9.x86_64 | PGDG 1.20250815 | PGDG 1.20250815 | PGDG 1.20250815 | PIGSTY 1.20250815 el9.x86_64.pg14 : pguint_14 pguint_14-1.20250815-1PIGSTY.el9.x86_64.rpm
| |
| el9.aarch64 | PGDG 1.20250815 | PGDG 1.20250815 | PGDG 1.20250815 | PIGSTY 1.20250815 el9.aarch64.pg14 : pguint_14 pguint_14-1.20250815-1PIGSTY.el9.aarch64.rpm
| |
| el10.x86_64 | PGDG 1.20250815 | PGDG 1.20250815 | PGDG 1.20250815 | PGDG 1.20250815 | PIGSTY 1.20250815 el10.x86_64.pg14 : pguint_14 pguint_14-1.20250815-1PIGSTY.el10.x86_64.rpm
|
| el10.aarch64 | PGDG 1.20250815 | PGDG 1.20250815 | PGDG 1.20250815 | PGDG 1.20250815 | PIGSTY 1.20250815 el10.aarch64.pg14 : pguint_14 pguint_14-1.20250815-1PIGSTY.el10.aarch64.rpm
|
| d12.x86_64 | PIGSTY 1.20250815 d12.x86_64.pg18 : postgresql-18-pguint postgresql-18-pguint_1.20250815-1PIGSTY~bookworm_amd64.deb
| PIGSTY 1.20250815 d12.x86_64.pg17 : postgresql-17-pguint postgresql-17-pguint_1.20250815-1PIGSTY~bookworm_amd64.deb
| PIGSTY 1.20250815 d12.x86_64.pg16 : postgresql-16-pguint postgresql-16-pguint_1.20250815-1PIGSTY~bookworm_amd64.deb
| PIGSTY 1.20250815 d12.x86_64.pg15 : postgresql-15-pguint postgresql-15-pguint_1.20250815-1PIGSTY~bookworm_amd64.deb
| PIGSTY 1.20250815 d12.x86_64.pg14 : postgresql-14-pguint postgresql-14-pguint_1.20250815-1PIGSTY~bookworm_amd64.deb
|
| d12.aarch64 | PIGSTY 1.20250815 d12.aarch64.pg18 : postgresql-18-pguint postgresql-18-pguint_1.20250815-1PIGSTY~bookworm_arm64.deb
| PIGSTY 1.20250815 d12.aarch64.pg17 : postgresql-17-pguint postgresql-17-pguint_1.20250815-1PIGSTY~bookworm_arm64.deb
| PIGSTY 1.20250815 d12.aarch64.pg16 : postgresql-16-pguint postgresql-16-pguint_1.20250815-1PIGSTY~bookworm_arm64.deb
| PIGSTY 1.20250815 d12.aarch64.pg15 : postgresql-15-pguint postgresql-15-pguint_1.20250815-1PIGSTY~bookworm_arm64.deb
| PIGSTY 1.20250815 d12.aarch64.pg14 : postgresql-14-pguint postgresql-14-pguint_1.20250815-1PIGSTY~bookworm_arm64.deb
|
| d13.x86_64 | PIGSTY 1.20250815 d13.x86_64.pg18 : postgresql-18-pguint postgresql-18-pguint_1.20250815-1PIGSTY~trixie_amd64.deb
| PIGSTY 1.20250815 d13.x86_64.pg17 : postgresql-17-pguint postgresql-17-pguint_1.20250815-1PIGSTY~trixie_amd64.deb
| PIGSTY 1.20250815 d13.x86_64.pg16 : postgresql-16-pguint postgresql-16-pguint_1.20250815-1PIGSTY~trixie_amd64.deb
| PIGSTY 1.20250815 d13.x86_64.pg15 : postgresql-15-pguint postgresql-15-pguint_1.20250815-1PIGSTY~trixie_amd64.deb
| PIGSTY 1.20250815 d13.x86_64.pg14 : postgresql-14-pguint postgresql-14-pguint_1.20250815-1PIGSTY~trixie_amd64.deb
|
| d13.aarch64 | PIGSTY 1.20250815 d13.aarch64.pg18 : postgresql-18-pguint postgresql-18-pguint_1.20250815-1PIGSTY~trixie_arm64.deb
| PIGSTY 1.20250815 d13.aarch64.pg17 : postgresql-17-pguint postgresql-17-pguint_1.20250815-1PIGSTY~trixie_arm64.deb
| PIGSTY 1.20250815 d13.aarch64.pg16 : postgresql-16-pguint postgresql-16-pguint_1.20250815-1PIGSTY~trixie_arm64.deb
| PIGSTY 1.20250815 d13.aarch64.pg15 : postgresql-15-pguint postgresql-15-pguint_1.20250815-1PIGSTY~trixie_arm64.deb
| PIGSTY 1.20250815 d13.aarch64.pg14 : postgresql-14-pguint postgresql-14-pguint_1.20250815-1PIGSTY~trixie_arm64.deb
|
| u22.x86_64 | PIGSTY 1.20250815 u22.x86_64.pg18 : postgresql-18-pguint postgresql-18-pguint_1.20250815-1PIGSTY~jammy_amd64.deb
| PIGSTY 1.20250815 u22.x86_64.pg17 : postgresql-17-pguint postgresql-17-pguint_1.20250815-1PIGSTY~jammy_amd64.deb
| PIGSTY 1.20250815 u22.x86_64.pg16 : postgresql-16-pguint postgresql-16-pguint_1.20250815-1PIGSTY~jammy_amd64.deb
| PIGSTY 1.20250815 u22.x86_64.pg15 : postgresql-15-pguint postgresql-15-pguint_1.20250815-1PIGSTY~jammy_amd64.deb
| PIGSTY 1.20250815 u22.x86_64.pg14 : postgresql-14-pguint postgresql-14-pguint_1.20250815-1PIGSTY~jammy_amd64.deb
|
| u22.aarch64 | PIGSTY 1.20250815 u22.aarch64.pg18 : postgresql-18-pguint postgresql-18-pguint_1.20250815-1PIGSTY~jammy_arm64.deb
| PIGSTY 1.20250815 u22.aarch64.pg17 : postgresql-17-pguint postgresql-17-pguint_1.20250815-1PIGSTY~jammy_arm64.deb
| PIGSTY 1.20250815 u22.aarch64.pg16 : postgresql-16-pguint postgresql-16-pguint_1.20250815-1PIGSTY~jammy_arm64.deb
| PIGSTY 1.20250815 u22.aarch64.pg15 : postgresql-15-pguint postgresql-15-pguint_1.20250815-1PIGSTY~jammy_arm64.deb
| PIGSTY 1.20250815 u22.aarch64.pg14 : postgresql-14-pguint postgresql-14-pguint_1.20250815-1PIGSTY~jammy_arm64.deb
|
| u24.x86_64 | PIGSTY 1.20250815 u24.x86_64.pg18 : postgresql-18-pguint postgresql-18-pguint_1.20250815-1PIGSTY~noble_amd64.deb
| PIGSTY 1.20250815 u24.x86_64.pg17 : postgresql-17-pguint postgresql-17-pguint_1.20250815-1PIGSTY~noble_amd64.deb
| PIGSTY 1.20250815 u24.x86_64.pg16 : postgresql-16-pguint postgresql-16-pguint_1.20250815-1PIGSTY~noble_amd64.deb
| PIGSTY 1.20250815 u24.x86_64.pg15 : postgresql-15-pguint postgresql-15-pguint_1.20250815-1PIGSTY~noble_amd64.deb
| PIGSTY 1.20250815 u24.x86_64.pg14 : postgresql-14-pguint postgresql-14-pguint_1.20250815-1PIGSTY~noble_amd64.deb
|
| u24.aarch64 | PIGSTY 1.20250815 u24.aarch64.pg18 : postgresql-18-pguint postgresql-18-pguint_1.20250815-1PIGSTY~noble_arm64.deb
| PIGSTY 1.20250815 u24.aarch64.pg17 : postgresql-17-pguint postgresql-17-pguint_1.20250815-1PIGSTY~noble_arm64.deb
| PIGSTY 1.20250815 u24.aarch64.pg16 : postgresql-16-pguint postgresql-16-pguint_1.20250815-1PIGSTY~noble_arm64.deb
| PIGSTY 1.20250815 u24.aarch64.pg15 : postgresql-15-pguint postgresql-15-pguint_1.20250815-1PIGSTY~noble_arm64.deb
| PIGSTY 1.20250815 u24.aarch64.pg14 : postgresql-14-pguint postgresql-14-pguint_1.20250815-1PIGSTY~noble_arm64.deb
|
| u26.x86_64 | PIGSTY 1.20250815 u26.x86_64.pg18 : postgresql-18-pguint postgresql-18-pguint_1.20250815-1PIGSTY~resolute_amd64.deb
| PIGSTY 1.20250815 u26.x86_64.pg17 : postgresql-17-pguint postgresql-17-pguint_1.20250815-1PIGSTY~resolute_amd64.deb
| PIGSTY 1.20250815 u26.x86_64.pg16 : postgresql-16-pguint postgresql-16-pguint_1.20250815-1PIGSTY~resolute_amd64.deb
| PIGSTY 1.20250815 u26.x86_64.pg15 : postgresql-15-pguint postgresql-15-pguint_1.20250815-1PIGSTY~resolute_amd64.deb
| PIGSTY 1.20250815 u26.x86_64.pg14 : postgresql-14-pguint postgresql-14-pguint_1.20250815-1PIGSTY~resolute_amd64.deb
|
| u26.aarch64 | PIGSTY 1.20250815 u26.aarch64.pg18 : postgresql-18-pguint postgresql-18-pguint_1.20250815-1PIGSTY~resolute_arm64.deb
| PIGSTY 1.20250815 u26.aarch64.pg17 : postgresql-17-pguint postgresql-17-pguint_1.20250815-1PIGSTY~resolute_arm64.deb
| PIGSTY 1.20250815 u26.aarch64.pg16 : postgresql-16-pguint postgresql-16-pguint_1.20250815-1PIGSTY~resolute_arm64.deb
| PIGSTY 1.20250815 u26.aarch64.pg15 : postgresql-15-pguint postgresql-15-pguint_1.20250815-1PIGSTY~resolute_arm64.deb
| PIGSTY 1.20250815 u26.aarch64.pg14 : postgresql-14-pguint postgresql-14-pguint_1.20250815-1PIGSTY~resolute_arm64.deb
|
构建
您可以使用 pig build 命令构建 pguint 扩展的 RPM / DEB 包:
pig build pkg pguint # 构建 RPM / DEB 包
安装
您可以直接安装 pguint 扩展包的预置二进制包,首先确保 PGDG 和 PIGSTY 仓库已经添加并启用:
pig repo add pgsql -u # 添加仓库并更新缓存
使用 pig 或者是 apt/yum/dnf 安装扩展:
pig install pguint; # 当前活跃 PG 版本安装
pig ext install -y pguint -v 18 # PG 18
pig ext install -y pguint -v 17 # PG 17
pig ext install -y pguint -v 16 # PG 16
pig ext install -y pguint -v 15 # PG 15
pig ext install -y pguint -v 14 # PG 14
dnf install -y pguint_18 # PG 18
dnf install -y pguint_17 # PG 17
dnf install -y pguint_16 # PG 16
dnf install -y pguint_15 # PG 15
dnf install -y pguint_14 # PG 14
apt install -y postgresql-18-pguint # PG 18
apt install -y postgresql-17-pguint # PG 17
apt install -y postgresql-16-pguint # PG 16
apt install -y postgresql-15-pguint # PG 15
apt install -y postgresql-14-pguint # PG 14
创建扩展:
CREATE EXTENSION uint;
用法
uint 扩展为 PostgreSQL 添加了无符号整数和小整数类型。
CREATE EXTENSION uint;
数据类型
| 类型 | 说明 | 范围 |
|---|---|---|
int1 | 有符号 8 位整数 | -128 到 127 |
uint1 | 无符号 8 位整数 | 0 到 255 |
uint2 | 无符号 16 位整数 | 0 到 65535 |
uint4 | 无符号 32 位整数 | 0 到 4294967295 |
uint8 | 无符号 64 位整数 | 0 到 18446744073709551615 |
用法
CREATE TABLE foo (
a uint4,
b text
);
SELECT * FROM foo WHERE a > 4;
SELECT avg(a) FROM foo;
运算符和函数
所有类型包含完整的算术运算符(+、-、*、/、%)、比较运算符(=、<>、<、>、<=、>=)以及各类型组合之间的运算符。同时提供标准聚合函数和索引支持(Btree、Hash)。