bigint
有符号八字节整数
当前查看 PostgreSQL 18。
中文定义与说明
有符号八字节整数
同版本中文手册节选
数字类型包括 2、4、8 字节的整数,4、8 字节的浮点数,以及可选精度的小数。表 8.2 列出了所有可用类型。
数字类型常量的语法在第 4.1.2 节里描述。数字类型有一整套对应的算术操作符和函数。相关信息请参考第 9 章。下面的几节详细描述这些类型。
PG10–20 核心源码清单。类型转换与操作符类列出源码显式声明的关系;缺少记录不能排除通过其他机制进行转换或使用索引。
定义
SQL 名称与别名: int8
有符号八字节整数
bigint
- 目录名称
- pg_catalog.int8
- 类型 OID
- 20
- 类型种类
- 基础类型
- 声明长度
- 8 字节
- 存储策略
- plain
- 输入函数
- int8in
- 输出函数
- int8out
- 手册中的声明
- bigint
- 存储大小
- 8 字节
- 手册说明
- 大范围整数
- 范围
- -9223372036854775808 到 +9223372036854775807
系统目录属性
此构建的源码初始化值。字段含义参见 pg_type 。包含头文件默认值;依赖构建的常量保留符号形式,不作为服务器运行时实测。
oid20descr~18 digit integer, 8-byte storagetypacl_null_typlen8typelem0typnameint8typsendint8sendtyptypebtypaligndtyparray0typbyvalFLOAT8PASSBYVALtypdelim','typinputint8intypmodin-typndims0typownerPOSTGREStyprelid0typmodout-typoutputint8outtyptypmod-1typanalyze-typdefault_null_typnotnullftypreceiveint8recvtypstorageptypbasetype0typcategoryNtypcollation0typisdefinedttypnamespacepg_catalogtypsubscript-typdefaultbin_null_array_type_oid1016typispreferredfarray_type_name_int8
类型转换 40
与此类型相关的显式 pg_cast 记录。PostgreSQL 还支持 pg_cast 之外的类型转换,缺少记录不能证明转换不可能。
| 源类型 | 目标类型 | 转换上下文 | 转换方式 | 函数 |
|---|---|---|---|---|
int8 | int2 | 赋值 | 函数 | int2(int8) |
int8 | int4 | 赋值 | 函数 | int4(int8) |
int8 | float4 | 隐式 | 函数 | float4(int8) |
int8 | float8 | 隐式 | 函数 | float8(int8) |
int8 | numeric | 隐式 | 函数 | numeric(int8) |
int2 | int8 | 隐式 | 函数 | int8(int2) |
int4 | int8 | 隐式 | 函数 | int8(int4) |
float4 | int8 | 赋值 | 函数 | int8(float4) |
float8 | int8 | 赋值 | 函数 | int8(float8) |
numeric | int8 | 赋值 | 函数 | int8(numeric) |
int8 | money | 赋值 | 函数 | money(int8) |
int8 | oid | 隐式 | 函数 | oid |
oid | int8 | 赋值 | 函数 | int8(oid) |
int8 | regproc | 隐式 | 函数 | oid |
regproc | int8 | 赋值 | 函数 | int8(oid) |
int8 | regprocedure | 隐式 | 函数 | oid |
regprocedure | int8 | 赋值 | 函数 | int8(oid) |
int8 | regoper | 隐式 | 函数 | oid |
regoper | int8 | 赋值 | 函数 | int8(oid) |
int8 | regoperator | 隐式 | 函数 | oid |
regoperator | int8 | 赋值 | 函数 | int8(oid) |
int8 | regclass | 隐式 | 函数 | oid |
regclass | int8 | 赋值 | 函数 | int8(oid) |
int8 | regcollation | 隐式 | 函数 | oid |
regcollation | int8 | 赋值 | 函数 | int8(oid) |
int8 | regtype | 隐式 | 函数 | oid |
regtype | int8 | 赋值 | 函数 | int8(oid) |
int8 | regconfig | 隐式 | 函数 | oid |
regconfig | int8 | 赋值 | 函数 | int8(oid) |
int8 | regdictionary | 隐式 | 函数 | oid |
regdictionary | int8 | 赋值 | 函数 | int8(oid) |
int8 | regrole | 隐式 | 函数 | oid |
regrole | int8 | 赋值 | 函数 | int8(oid) |
int8 | regnamespace | 隐式 | 函数 | oid |
regnamespace | int8 | 赋值 | 函数 | int8(oid) |
int8 | bytea | 显式 | 函数 | bytea(int8) |
bytea | int8 | 显式 | 函数 | int8(bytea) |
int8 | bit | 显式 | 函数 | bit(int8,int4) |
bit | int8 | 显式 | 函数 | int8(bit) |
jsonb | int8 | 显式 | 函数 | int8(jsonb) |
运算符重载 66
每种操作数签名均为独立重载。实现函数和返回类型来自同一源码构建。
操作符类 5
声明输入类型与此类型相符的操作符类。多态操作符类、类型转换和表达式索引还可能提供其他索引路径;不能仅凭此表判断是否支持索引。
版本比较
PostgreSQL 17 → 18。属性比较不包含构建标识和说明正文;原始目录字段与源描述保留原文。
类型转换
PostgreSQL 17
[{"castcontext": "a", "castfunc": "int2(int8)", "castmethod": "f", "castsource": "int8", "casttarget": "int2"}, {"castcontext": "a", "castfunc": "int4(int8)", "castmethod": "f", "castsource": "int8", "casttarget": "int4"}, {"castcontext": "a", "castfunc": "int8(float4)", "castmethod": "f", "castsource": "float4", "casttarget": "int8"}, {"castcontext": "a", "castfunc": "int8(float8)", "castmethod": "f", "castsource": "float8", "casttarget": "int8"}, {"castcontext": "a", "castfunc": "int8(numeric)", "castmethod": "f", "castsource": "numeric", "casttarget": "int8"}, {"castcontext": "a", "castfunc": "int8(oid)", "castmethod": "f", "castsource": "oid", "casttarget": "int8"}, {"castcontext": "a", "castfunc": "int8(oid)", "castmethod": "f", "castsource": "regclass", "casttarget": "int8"}, {"castcontext": "a", "castfunc": "int8(oid)", "castmethod": "f", "castsource": "regcollation", "casttarget": "int8"}, {"castcontext": "a", "castfunc": "int8(oid)", "castmethod": "f", "castsource": "regconfig", "casttarget": "int8"}, {"castcontext": "a", "castfunc": "int8(oid)", "castmethod": "f", "castsource": "regdictionary", "casttarget": "int8"}, {"castcontext": "a", "castfunc": "int8(oid)", "castmethod": "f", "castsource": "regnamespace", "casttarget": "int8"}, {"castcontext": "a", "castfunc": "int8(oid)", "castmethod": "f", "castsource": "regoper", "casttarget": "int8"}, {"castcontext": "a", "castfunc": "int8(oid)", "castmethod": "f", "castsource": "regoperator", "casttarget": "int8"}, {"castcontext": "a", "castfunc": "int8(oid)", "castmethod": "f", "castsource": "regproc", "casttarget": "int8"}, {"castcontext": "a", "castfunc": "int8(oid)", "castmethod": "f", "castsource": "regprocedure", "casttarget": "int8"}, {"castcontext": "a", "castfunc": "int8(oid)", "castmethod": "f", "castsource": "regrole", "casttarget": "int8"}, {"castcontext": "a", "castfunc": "int8(oid)", "castmethod": "f", "castsource": "regtype", "casttarget": "int8"}, {"castcontext": "a", "castfunc": "money(int8)", "castmethod": "f", "castsource": "int8", "casttarget": "money"}, {"castcontext": "e", "castfunc": "bit(int8,int4)", "castmethod": "f", "castsource": "int8", "casttarget": "bit"}, {"castcontext": "e", "castfunc": "int8(bit)", "castmethod": "f", "castsource": "bit", "casttarget": "int8"}, {"castcontext": "e", "castfunc": "int8(jsonb)", "castmethod": "f", "castsource": "jsonb", "casttarget": "int8"}, {"castcontext": "i", "castfunc": "float4(int8)", "castmethod": "f", "castsource": "int8", "casttarget": "float4"}, {"castcontext": "i", "castfunc": "float8(int8)", "castmethod": "f", "castsource": "int8", "casttarget": "float8"}, {"castcontext": "i", "castfunc": "int8(int2)", "castmethod": "f", "castsource": "int2", "casttarget": "int8"}, {"castcontext": "i", "castfunc": "int8(int4)", "castmethod": "f", "castsource": "int4", "casttarget": "int8"}, {"castcontext": "i", "castfunc": "numeric(int8)", "castmethod": "f", "castsource": "int8", "casttarget": "numeric"}, {"castcontext": "i", "castfunc": "oid", "castmethod": "f", "castsource": "int8", "casttarget": "oid"}, {"castcontext": "i", "castfunc": "oid", "castmethod": "f", "castsource": "int8", "casttarget": "regclass"}, {"castcontext": "i", "castfunc": "oid", "castmethod": "f", "castsource": "int8", "casttarget": "regcollation"}, {"castcontext": "i", "castfunc": "oid", "castmethod": "f", "castsource": "int8", "casttarget": "regconfig"}, {"castcontext": "i", "castfunc": "oid", "castmethod": "f", "castsource": "int8", "casttarget": "regdictionary"}, {"castcontext": "i", "castfunc": "oid", "castmethod": "f", "castsource": "int8", "casttarget": "regnamespace"}, {"castcontext": "i", "castfunc": "oid", "castmethod": "f", "castsource": "int8", "casttarget": "regoper"}, {"castcontext": "i", "castfunc": "oid", "castmethod": "f", "castsource": "int8", "casttarget": "regoperator"}, {"castcontext": "i", "castfunc": "oid", "castmethod": "f", "castsource": "int8", "casttarget": "regproc"}, {"castcontext": "i", "castfunc": "oid", "castmethod": "f", "castsource": "int8", "casttarget": "regprocedure"}, {"castcontext": "i", "castfunc": "oid", "castmethod": "f", "castsource": "int8", "casttarget": "regrole"}, {"castcontext": "i", "castfunc": "oid", "castmethod": "f", "castsource": "int8", "casttarget": "regtype"}]PostgreSQL 18
[{"castcontext": "a", "castfunc": "int2(int8)", "castmethod": "f", "castsource": "int8", "casttarget": "int2"}, {"castcontext": "a", "castfunc": "int4(int8)", "castmethod": "f", "castsource": "int8", "casttarget": "int4"}, {"castcontext": "a", "castfunc": "int8(float4)", "castmethod": "f", "castsource": "float4", "casttarget": "int8"}, {"castcontext": "a", "castfunc": "int8(float8)", "castmethod": "f", "castsource": "float8", "casttarget": "int8"}, {"castcontext": "a", "castfunc": "int8(numeric)", "castmethod": "f", "castsource": "numeric", "casttarget": "int8"}, {"castcontext": "a", "castfunc": "int8(oid)", "castmethod": "f", "castsource": "oid", "casttarget": "int8"}, {"castcontext": "a", "castfunc": "int8(oid)", "castmethod": "f", "castsource": "regclass", "casttarget": "int8"}, {"castcontext": "a", "castfunc": "int8(oid)", "castmethod": "f", "castsource": "regcollation", "casttarget": "int8"}, {"castcontext": "a", "castfunc": "int8(oid)", "castmethod": "f", "castsource": "regconfig", "casttarget": "int8"}, {"castcontext": "a", "castfunc": "int8(oid)", "castmethod": "f", "castsource": "regdictionary", "casttarget": "int8"}, {"castcontext": "a", "castfunc": "int8(oid)", "castmethod": "f", "castsource": "regnamespace", "casttarget": "int8"}, {"castcontext": "a", "castfunc": "int8(oid)", "castmethod": "f", "castsource": "regoper", "casttarget": "int8"}, {"castcontext": "a", "castfunc": "int8(oid)", "castmethod": "f", "castsource": "regoperator", "casttarget": "int8"}, {"castcontext": "a", "castfunc": "int8(oid)", "castmethod": "f", "castsource": "regproc", "casttarget": "int8"}, {"castcontext": "a", "castfunc": "int8(oid)", "castmethod": "f", "castsource": "regprocedure", "casttarget": "int8"}, {"castcontext": "a", "castfunc": "int8(oid)", "castmethod": "f", "castsource": "regrole", "casttarget": "int8"}, {"castcontext": "a", "castfunc": "int8(oid)", "castmethod": "f", "castsource": "regtype", "casttarget": "int8"}, {"castcontext": "a", "castfunc": "money(int8)", "castmethod": "f", "castsource": "int8", "casttarget": "money"}, {"castcontext": "e", "castfunc": "bit(int8,int4)", "castmethod": "f", "castsource": "int8", "casttarget": "bit"}, {"castcontext": "e", "castfunc": "bytea(int8)", "castmethod": "f", "castsource": "int8", "casttarget": "bytea"}, {"castcontext": "e", "castfunc": "int8(bit)", "castmethod": "f", "castsource": "bit", "casttarget": "int8"}, {"castcontext": "e", "castfunc": "int8(bytea)", "castmethod": "f", "castsource": "bytea", "casttarget": "int8"}, {"castcontext": "e", "castfunc": "int8(jsonb)", "castmethod": "f", "castsource": "jsonb", "casttarget": "int8"}, {"castcontext": "i", "castfunc": "float4(int8)", "castmethod": "f", "castsource": "int8", "casttarget": "float4"}, {"castcontext": "i", "castfunc": "float8(int8)", "castmethod": "f", "castsource": "int8", "casttarget": "float8"}, {"castcontext": "i", "castfunc": "int8(int2)", "castmethod": "f", "castsource": "int2", "casttarget": "int8"}, {"castcontext": "i", "castfunc": "int8(int4)", "castmethod": "f", "castsource": "int4", "casttarget": "int8"}, {"castcontext": "i", "castfunc": "numeric(int8)", "castmethod": "f", "castsource": "int8", "casttarget": "numeric"}, {"castcontext": "i", "castfunc": "oid", "castmethod": "f", "castsource": "int8", "casttarget": "oid"}, {"castcontext": "i", "castfunc": "oid", "castmethod": "f", "castsource": "int8", "casttarget": "regclass"}, {"castcontext": "i", "castfunc": "oid", "castmethod": "f", "castsource": "int8", "casttarget": "regcollation"}, {"castcontext": "i", "castfunc": "oid", "castmethod": "f", "castsource": "int8", "casttarget": "regconfig"}, {"castcontext": "i", "castfunc": "oid", "castmethod": "f", "castsource": "int8", "casttarget": "regdictionary"}, {"castcontext": "i", "castfunc": "oid", "castmethod": "f", "castsource": "int8", "casttarget": "regnamespace"}, {"castcontext": "i", "castfunc": "oid", "castmethod": "f", "castsource": "int8", "casttarget": "regoper"}, {"castcontext": "i", "castfunc": "oid", "castmethod": "f", "castsource": "int8", "casttarget": "regoperator"}, {"castcontext": "i", "castfunc": "oid", "castmethod": "f", "castsource": "int8", "casttarget": "regproc"}, {"castcontext": "i", "castfunc": "oid", "castmethod": "f", "castsource": "int8", "casttarget": "regprocedure"}, {"castcontext": "i", "castfunc": "oid", "castmethod": "f", "castsource": "int8", "casttarget": "regrole"}, {"castcontext": "i", "castfunc": "oid", "castmethod": "f", "castsource": "int8", "casttarget": "regtype"}]文档与源码
- 构建
- 18.6 · https://ftp.postgresql.org/pub/source/v18.6/postgresql-18.6.tar.bz2
- 指纹
555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f
相关条目
全部数据类型 · 下载此版本 JSON · 最早收录的样本不代表该类型的实际引入版本。