{"kind": "type", "slug": "numeric", "name": "numeric", "major": "18", "snapshot": {"casts": [{"castfunc": "numeric(int8)", "castmethod": "f", "castsource": "int8", "casttarget": "numeric", "castcontext": "i"}, {"castfunc": "numeric(int2)", "castmethod": "f", "castsource": "int2", "casttarget": "numeric", "castcontext": "i"}, {"castfunc": "numeric(int4)", "castmethod": "f", "castsource": "int4", "casttarget": "numeric", "castcontext": "i"}, {"castfunc": "numeric(float4)", "castmethod": "f", "castsource": "float4", "casttarget": "numeric", "castcontext": "a"}, {"castfunc": "numeric(float8)", "castmethod": "f", "castsource": "float8", "casttarget": "numeric", "castcontext": "a"}, {"castfunc": "int8(numeric)", "castmethod": "f", "castsource": "numeric", "casttarget": "int8", "castcontext": "a"}, {"castfunc": "int2(numeric)", "castmethod": "f", "castsource": "numeric", "casttarget": "int2", "castcontext": "a"}, {"castfunc": "int4(numeric)", "castmethod": "f", "castsource": "numeric", "casttarget": "int4", "castcontext": "a"}, {"castfunc": "float4(numeric)", "castmethod": "f", "castsource": "numeric", "casttarget": "float4", "castcontext": "i"}, {"castfunc": "float8(numeric)", "castmethod": "f", "castsource": "numeric", "casttarget": "float8", "castcontext": "i"}, {"castfunc": "numeric(money)", "castmethod": "f", "castsource": "money", "casttarget": "numeric", "castcontext": "a"}, {"castfunc": "money(numeric)", "castmethod": "f", "castsource": "numeric", "casttarget": "money", "castcontext": "a"}, {"castfunc": "numeric(numeric,int4)", "castmethod": "f", "castsource": "numeric", "casttarget": "numeric", "castcontext": "i"}, {"castfunc": "numeric(jsonb)", "castmethod": "f", "castsource": "jsonb", "casttarget": "numeric", "castcontext": "e"}], "facts": [{"label": "目录名称", "value": "pg_catalog.numeric"}, {"label": "类型 OID", "value": "1700"}, {"label": "类型种类", "value": "基础类型"}, {"label": "声明长度", "value": "变长（varlena）"}, {"label": "存储策略", "value": "main"}, {"label": "输入函数", "value": "numeric_in"}, {"label": "输出函数", "value": "numeric_out"}, {"label": "手册中的声明", "value": "decimal"}, {"label": "存储大小", "value": "可变"}, {"label": "手册说明", "value": "用户指定精度，精确"}, {"label": "范围", "value": "小数点前最多 131072 位，小数点后最多 16383 位"}, {"label": "手册中的声明", "value": "numeric"}], "ranges": [], "aliases": ["decimal [ ( p , s ) ]"], "catalog": {"oid": "1700", "descr": "'numeric(precision, scale)' arbitrary precision number", "typacl": "_null_", "typlen": "-1", "typelem": "0", "typname": "numeric", "typsend": "numeric_send", "typtype": "b", "typalign": "i", "typarray": "0", "typbyval": "f", "typdelim": "','", "typinput": "numeric_in", "typmodin": "numerictypmodin", "typndims": "0", "typowner": "POSTGRES", "typrelid": "0", "typmodout": "numerictypmodout", "typoutput": "numeric_out", "typtypmod": "-1", "typanalyze": "-", "typdefault": "_null_", "typnotnull": "f", "typreceive": "numeric_recv", "typstorage": "m", "typbasetype": "0", "typcategory": "N", "typcollation": "0", "typisdefined": "t", "typnamespace": "pg_catalog", "typsubscript": "-", "typdefaultbin": "_null_", "array_type_oid": "1231", "typispreferred": "f", "array_type_name": "_numeric"}, "related": [{"url": "/wiki/catalog/pg_type/?v=18", "label": "pg_type 系统目录"}, {"url": "/wiki/catalog/pg_cast/?v=18", "label": "pg_cast 系统目录"}, {"url": "/wiki/catalog/pg_operator/?v=18", "label": "pg_operator 系统目录"}, {"url": "/wiki/catalog/pg_opclass/?v=18", "label": "pg_opclass 系统目录"}, {"url": "/wiki/type/arrays/?v=18", "label": "数组"}, {"url": "/wiki/indexam/brin/?v=18", "label": "brin 索引访问方法"}, {"url": "/wiki/indexam/btree/?v=18", "label": "btree 索引访问方法"}, {"url": "/wiki/indexam/hash/?v=18", "label": "hash 索引访问方法"}], "release": {"ref": "https://ftp.postgresql.org/pub/source/v18.6/postgresql-18.6.tar.bz2", "label": "18.6", "major": "18", "channel": "stable", "revision": "555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f", "source_files": {"doc/src/sgml/datatype.sgml": "86328daa77e20d81d222376ec0306d9841a17104e436c08d138eb763aefb3700", "src/include/catalog/pg_am.h": "3426799df799f32163fcc0765f43dbdb5e88e626acf31284fef9fc6014b69d8e", "src/include/catalog/pg_am.dat": "b3cb86b102a42fb0024cbd99779c9897afb40d12a71f5cc5a0e5aee7ff2f9969", "src/include/catalog/pg_cast.h": "de585c7df687d698e7d1d100dce8a794ac9da52414ea48169191019178c8f053", "src/include/catalog/pg_proc.h": "f7d59f07c5b95e2f3c7141762a0f576e8a3af7581ba54c27537f4d500472bea5", "src/include/catalog/pg_type.h": "8fb198749fd82b6c1818a3c18455f226f66116fcfeb3d4959c65ce3fda22802e", "src/include/catalog/pg_range.h": "45546d952b5181f989bd9234721897fc2b37005c8e49ce2ddc156f26974c3ca4", "src/include/catalog/pg_cast.dat": "97911281ca2c81917394ccb2ec13367e37c6801fd461d5e1a3d2f28b911b46b2", "src/include/catalog/pg_proc.dat": "1f934ce80d460159dda137714374a35f9896315ea2476709cbb4da13b38ef95a", "src/include/catalog/pg_type.dat": "5f5887b75677cba2d4a1a0cfeb355df5ed91f85d385fac88bd8d7c605b3578f9", "src/include/catalog/pg_opclass.h": "9c218537806c8ef0398302faaca7f91315dfc1198c48706cebffb479b68defaf", "src/include/catalog/pg_range.dat": "5c2271f8e89e9378d1887204e5785060b77405b5f0ff3e6c719250c9c1dcfcc4", "src/include/catalog/pg_operator.h": "621b18cfffe102413d79b746ce7a10f77fc60fdd097bac34c22b31070d3ee3c4", "src/include/catalog/pg_opfamily.h": "e1f5fc8aebd3042df847455bf66bf755f768c2aa8a9b03d22f7ec8563eba59c0", "src/include/catalog/pg_opclass.dat": "4ee7d3619a6aa106e1c0db55de903931c7d11b1c60ba053a022519c55f8ee668", "src/include/catalog/pg_operator.dat": "5d35b9b2ef5f9797cc815263927ef8a12367fedace53e828b4e8b320e2a7f703", "src/include/catalog/pg_opfamily.dat": "3b694879027b858f2ecf1fa1152b7e30c6e15a216ba99c2384291c30e9d52311"}, "manual_sha256": {"arrays.html": "0e1d5c5a7b4a949d4439995f44f74ad4264e050d16eb9ad2a850fbaee04032df", "domains.html": "82d486973ccc35d14276627a67ac76b434452f23f9ed4d8aa3fbb01fdf285fc2", "datatype.html": "e581f67c74e42006289638c8659e9b338adbfd7f068bd8bf2b3be3880fcd2254", "rowtypes.html": "74f99e029c3a9edfd3e18810ba3c8cb66d3aada91eb67b86476560871e6617e9", "rangetypes.html": "e4960abc7ce8e51d794f94f1e57b099d30b7f75dd7f2b23a960eef91f6291c33", "datatype-bit.html": "c49124aad561636c18080b9e09572fde7785a6b9eae86f5a33283f0fd6774c37", "datatype-oid.html": "8b3360302225f08ae72716ce1804596de95b568e5d31f788cb4597427b28cc38", "datatype-xml.html": "061fc2295b7b69be704f0a741b8decd10ad721059f871fb0243c669bb54d7822", "datatype-enum.html": "cab38e53222e30cc94b24de4b33634fd22d7c93f58ebcf35f646c9b8da78fae8", "datatype-json.html": "650162a05b660146b500a205d523374d00aee117a6a6240d30262be51b6e33e5", "datatype-uuid.html": "292b307b3223c6182bdba687e7f69e6dca9038430143ad79d56327f6ed4c3246", "datatype-money.html": "8b29c14b90679683ac5c472b59a0a7e2853f32cc7db43fab417b2697a6879964", "functions-info.html": "78ac80bf81da2e4f4a33f3b850faa86f0f58ec54a083d6c31da557907de0df87", "catalog-pg-type.html": "ea9c9313bab8e92a7da18ebc50c7ff1f908dd80999a7e0ca3bbc82ba626c58d4", "datatype-binary.html": "0c03ec47b76e37888a3da7f5dcfd340128a5d356642a85185cc9ebe17856a904", "datatype-pg-lsn.html": "339172f5107cc7eb7139bec911277647219e92a532cebd0f3da0a5dacf8195af", "datatype-pseudo.html": "c7cf0b8214304bd8702c95f2142671ae5f0d631f83717f9c07d9e1f2579961b4", "datatype-boolean.html": "b633f663e6c8276e7056287640c413aa79dbc15d5353cee0d41653d58d376956", "datatype-numeric.html": "b74619f7ac2f1ca9f85c48073df78c33dd30e464e61baba6008634534edcb500", "sql-createdomain.html": "e94f927196de1b0ea1ce35cd4603c1f6f544439adcc0edf1c4222358e832245b", "datatype-datetime.html": "e366275d8b13845bfa4ef0d68faa093e5f3ecb708a1ec870cbcbf7e425b85699", "datatype-character.html": "c73eebe413ea709a7792e4cfc3cfe9fb68cb496ebe83c3ebaa9d09f8c40d0f73", "datatype-geometric.html": "0eb3053cfe7d6b0a4b5592c5d7af8d97cae527e87f063c5793413bcba5c14cd9", "datatype-net-types.html": "96846e641cc37727ddcd8b8a1aa0dbe33cd9787760a2b4efb0dcb9403d5be63f", "datatype-textsearch.html": "4b15e05be8b49a71b28aea22f2c46d0dbf639a91e7b4fe129a4c737c6daad47c"}, "source_sha256": "555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f"}, "sources": [{"url": "https://pg.center/docs/18/datatype-numeric.html", "path": "datatype-numeric.html", "label": "PostgreSQL 18 English manual", "sha256": "b74619f7ac2f1ca9f85c48073df78c33dd30e464e61baba6008634534edcb500", "language": "en", "original_url": "/docs/18/datatype-numeric.html"}, {"url": "https://ftp.postgresql.org/pub/source/v18.6/postgresql-18.6.tar.bz2", "label": "Matching PostgreSQL source archive", "sha256": "555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f"}], "coverage": "source inventory; exact declared input types for operator classes", "sections": [], "operators": [{"oid": "1751", "descr": "negate", "oprcom": "0", "oprcode": "numeric_uminus", "oprjoin": "-", "oprkind": "l", "oprleft": "0", "oprname": "-", "oprrest": "-", "oprowner": "POSTGRES", "oprright": "numeric", "oprnegate": "0", "oprresult": "numeric", "oprcanhash": "f", "oprcanmerge": "f", "oprnamespace": "pg_catalog"}, {"oid": "1752", "descr": "equal", "oprcom": "=(numeric,numeric)", "oprcode": "numeric_eq", "oprjoin": "eqjoinsel", "oprkind": "b", "oprleft": "numeric", "oprname": "=", "oprrest": "eqsel", "oprowner": "POSTGRES", "oprright": "numeric", "oprnegate": "<>(numeric,numeric)", "oprresult": "bool", "oprcanhash": "t", "oprcanmerge": "t", "oprnamespace": "pg_catalog"}, {"oid": "1753", "descr": "not equal", "oprcom": "<>(numeric,numeric)", "oprcode": "numeric_ne", "oprjoin": "neqjoinsel", "oprkind": "b", "oprleft": "numeric", "oprname": "<>", "oprrest": "neqsel", "oprowner": "POSTGRES", "oprright": "numeric", "oprnegate": "=(numeric,numeric)", "oprresult": "bool", "oprcanhash": "f", "oprcanmerge": "f", "oprnamespace": "pg_catalog"}, {"oid": "1754", "descr": "less than", "oprcom": ">(numeric,numeric)", "oprcode": "numeric_lt", "oprjoin": "scalarltjoinsel", "oprkind": "b", "oprleft": "numeric", "oprname": "<", "oprrest": "scalarltsel", "oprowner": "POSTGRES", "oprright": "numeric", "oprnegate": ">=(numeric,numeric)", "oprresult": "bool", "oprcanhash": "f", "oprcanmerge": "f", "oprnamespace": "pg_catalog"}, {"oid": "1755", "descr": "less than or equal", "oprcom": ">=(numeric,numeric)", "oprcode": "numeric_le", "oprjoin": "scalarlejoinsel", "oprkind": "b", "oprleft": "numeric", "oprname": "<=", "oprrest": "scalarlesel", "oprowner": "POSTGRES", "oprright": "numeric", "oprnegate": ">(numeric,numeric)", "oprresult": "bool", "oprcanhash": "f", "oprcanmerge": "f", "oprnamespace": "pg_catalog"}, {"oid": "1756", "descr": "greater than", "oprcom": "<(numeric,numeric)", "oprcode": "numeric_gt", "oprjoin": "scalargtjoinsel", "oprkind": "b", "oprleft": "numeric", "oprname": ">", "oprrest": "scalargtsel", "oprowner": "POSTGRES", "oprright": "numeric", "oprnegate": "<=(numeric,numeric)", "oprresult": "bool", "oprcanhash": "f", "oprcanmerge": "f", "oprnamespace": "pg_catalog"}, {"oid": "1757", "descr": "greater than or equal", "oprcom": "<=(numeric,numeric)", "oprcode": "numeric_ge", "oprjoin": "scalargejoinsel", "oprkind": "b", "oprleft": "numeric", "oprname": ">=", "oprrest": "scalargesel", "oprowner": "POSTGRES", "oprright": "numeric", "oprnegate": "<(numeric,numeric)", "oprresult": "bool", "oprcanhash": "f", "oprcanmerge": "f", "oprnamespace": "pg_catalog"}, {"oid": "1758", "descr": "add", "oprcom": "+(numeric,numeric)", "oprcode": "numeric_add", "oprjoin": "-", "oprkind": "b", "oprleft": "numeric", "oprname": "+", "oprrest": "-", "oprowner": "POSTGRES", "oprright": "numeric", "oprnegate": "0", "oprresult": "numeric", "oprcanhash": "f", "oprcanmerge": "f", "oprnamespace": "pg_catalog"}, {"oid": "1759", "descr": "subtract", "oprcom": "0", "oprcode": "numeric_sub", "oprjoin": "-", "oprkind": "b", "oprleft": "numeric", "oprname": "-", "oprrest": "-", "oprowner": "POSTGRES", "oprright": "numeric", "oprnegate": "0", "oprresult": "numeric", "oprcanhash": "f", "oprcanmerge": "f", "oprnamespace": "pg_catalog"}, {"oid": "1760", "descr": "multiply", "oprcom": "*(numeric,numeric)", "oprcode": "numeric_mul", "oprjoin": "-", "oprkind": "b", "oprleft": "numeric", "oprname": "*", "oprrest": "-", "oprowner": "POSTGRES", "oprright": "numeric", "oprnegate": "0", "oprresult": "numeric", "oprcanhash": "f", "oprcanmerge": "f", "oprnamespace": "pg_catalog"}, {"oid": "1761", "descr": "divide", "oprcom": "0", "oprcode": "numeric_div", "oprjoin": "-", "oprkind": "b", "oprleft": "numeric", "oprname": "/", "oprrest": "-", "oprowner": "POSTGRES", "oprright": "numeric", "oprnegate": "0", "oprresult": "numeric", "oprcanhash": "f", "oprcanmerge": "f", "oprnamespace": "pg_catalog"}, {"oid": "1762", "descr": "modulus", "oprcom": "0", "oprcode": "numeric_mod", "oprjoin": "-", "oprkind": "b", "oprleft": "numeric", "oprname": "%", "oprrest": "-", "oprowner": "POSTGRES", "oprright": "numeric", "oprnegate": "0", "oprresult": "numeric", "oprcanhash": "f", "oprcanmerge": "f", "oprnamespace": "pg_catalog"}, {"oid": "1038", "descr": "exponentiation", "oprcom": "0", "oprcode": "numeric_power", "oprjoin": "-", "oprkind": "b", "oprleft": "numeric", "oprname": "^", "oprrest": "-", "oprowner": "POSTGRES", "oprright": "numeric", "oprnegate": "0", "oprresult": "numeric", "oprcanhash": "f", "oprcanmerge": "f", "oprnamespace": "pg_catalog"}, {"oid": "1763", "descr": "absolute value", "oprcom": "0", "oprcode": "numeric_abs", "oprjoin": "-", "oprkind": "l", "oprleft": "0", "oprname": "@", "oprrest": "-", "oprowner": "POSTGRES", "oprright": "numeric", "oprnegate": "0", "oprresult": "numeric", "oprcanhash": "f", "oprcanmerge": "f", "oprnamespace": "pg_catalog"}, {"oid": "1921", "descr": "unary plus", "oprcom": "0", "oprcode": "numeric_uplus", "oprjoin": "-", "oprkind": "l", "oprleft": "0", "oprname": "+", "oprrest": "-", "oprowner": "POSTGRES", "oprright": "numeric", "oprnegate": "0", "oprresult": "numeric", "oprcanhash": "f", "oprcanmerge": "f", "oprnamespace": "pg_catalog"}, {"oid": "5025", "descr": "add", "oprcom": "+(numeric,pg_lsn)", "oprcode": "pg_lsn_pli", "oprjoin": "-", "oprkind": "b", "oprleft": "pg_lsn", "oprname": "+", "oprrest": "-", "oprowner": "POSTGRES", "oprright": "numeric", "oprnegate": "0", "oprresult": "pg_lsn", "oprcanhash": "f", "oprcanmerge": "f", "oprnamespace": "pg_catalog"}, {"oid": "5026", "descr": "add", "oprcom": "+(pg_lsn,numeric)", "oprcode": "numeric_pl_pg_lsn", "oprjoin": "-", "oprkind": "b", "oprleft": "numeric", "oprname": "+", "oprrest": "-", "oprowner": "POSTGRES", "oprright": "pg_lsn", "oprnegate": "0", "oprresult": "pg_lsn", "oprcanhash": "f", "oprcanmerge": "f", "oprnamespace": "pg_catalog"}, {"oid": "5027", "descr": "subtract", "oprcom": "0", "oprcode": "pg_lsn_mii", "oprjoin": "-", "oprkind": "b", "oprleft": "pg_lsn", "oprname": "-", "oprrest": "-", "oprowner": "POSTGRES", "oprright": "numeric", "oprnegate": "0", "oprresult": "pg_lsn", "oprcanhash": "f", "oprcanmerge": "f", "oprnamespace": "pg_catalog"}], "signature": "numeric [ ( p , s ) ]", "description": ["可指定精度的精确数值"], "manual_html": "<div class=\"sect1\" id=\"DATATYPE-NUMERIC\">\n<div class=\"titlepage\">\n<div>\n<div>\n<h2 class=\"title\" lang=\"zh\">8.1. 数值类型</h2>\n</div>\n</div>\n</div>\n<p lang=\"zh\">数值类型包括二字节、四字节和八字节整数，四字节和八字节浮点数，以及可选精度的十进制数。表 8.2 列出了可用类型。</p>\n<div class=\"table\" id=\"DATATYPE-NUMERIC-TABLE\">\n<p class=\"title\" lang=\"zh\">表 8.2：数值类型</p>\n<div class=\"table-contents\">\n<table class=\"table\">\n<thead>\n<tr>\n<th lang=\"zh\">名字</th>\n<th lang=\"zh\">存储大小</th>\n<th lang=\"zh\">说明</th>\n<th lang=\"zh\">范围</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code class=\"type\">smallint</code></td>\n<td lang=\"zh\">2 字节</td>\n<td lang=\"zh\">小范围整数</td>\n<td lang=\"zh\">-32768 到 +32767</td>\n</tr>\n<tr>\n<td><code class=\"type\">integer</code></td>\n<td lang=\"zh\">4 字节</td>\n<td lang=\"zh\">整数的常用选择</td>\n<td lang=\"zh\">-2147483648 到 +2147483647</td>\n</tr>\n<tr>\n<td><code class=\"type\">bigint</code></td>\n<td lang=\"zh\">8 字节</td>\n<td lang=\"zh\">大范围整数</td>\n<td lang=\"zh\">-9223372036854775808 到 +9223372036854775807</td>\n</tr>\n<tr>\n<td><code class=\"type\">decimal</code></td>\n<td lang=\"zh\">可变</td>\n<td lang=\"zh\">用户指定精度，精确</td>\n<td lang=\"zh\">小数点前最多 131072 位，小数点后最多 16383 位</td>\n</tr>\n<tr>\n<td><code class=\"type\">numeric</code></td>\n<td lang=\"zh\">可变</td>\n<td lang=\"zh\">用户指定精度，精确</td>\n<td lang=\"zh\">小数点前最多 131072 位，小数点后最多 16383 位</td>\n</tr>\n<tr>\n<td><code class=\"type\">real</code></td>\n<td lang=\"zh\">4 字节</td>\n<td lang=\"zh\">可变精度，不精确</td>\n<td lang=\"zh\">6 位十进制有效数字</td>\n</tr>\n<tr>\n<td><code class=\"type\">double precision</code></td>\n<td lang=\"zh\">8 字节</td>\n<td lang=\"zh\">可变精度，不精确</td>\n<td lang=\"zh\">15 位十进制有效数字</td>\n</tr>\n<tr>\n<td><code class=\"type\">smallserial</code></td>\n<td lang=\"zh\">2 字节</td>\n<td lang=\"zh\">小型自增整数</td>\n<td lang=\"zh\">1 至 32767</td>\n</tr>\n<tr>\n<td><code class=\"type\">serial</code></td>\n<td lang=\"zh\">4 字节</td>\n<td lang=\"zh\">自增整数</td>\n<td lang=\"zh\">1 至 2147483647</td>\n</tr>\n<tr>\n<td><code class=\"type\">bigserial</code></td>\n<td lang=\"zh\">8 字节</td>\n<td lang=\"zh\">大型自增整数</td>\n<td lang=\"zh\">1 至 9223372036854775807</td>\n</tr>\n</tbody>\n</table>\n</div>\n</div><br class=\"table-break\"/>\n<p lang=\"zh\">数值类型常量的语法见第 4.1.2 节。数值类型拥有完整的对应算术运算符和函数，更多信息见第 9 章。以下各节详细介绍这些类型。</p>\n<div class=\"sect2\" id=\"DATATYPE-INT\">\n<div class=\"titlepage\">\n<div>\n<div>\n<h3 class=\"title\" lang=\"zh\">8.1.1. 整数类型</h3>\n</div>\n</div>\n</div>\n<p lang=\"zh\">smallint、integer 和 bigint 存储不含小数部分的整数，取值范围各不相同。尝试存储超出允许范围的值会报错。</p>\n<p lang=\"zh\">integer 是常用选择，在取值范围、存储大小和性能之间取得了最佳平衡。smallint 通常仅在磁盘空间非常紧张时使用；bigint 则用于 integer 范围不足的情况。</p>\n<p lang=\"zh\">SQL 仅规定了 integer（或 int）、smallint 和 bigint 这几种整数类型。类型名 int2、int4 和 int8 是扩展，一些其他 SQL 数据库系统也使用它们。</p>\n</div>\n<div class=\"sect2\" id=\"DATATYPE-NUMERIC-DECIMAL\">\n<div class=\"titlepage\">\n<div>\n<div>\n<h3 class=\"title\" lang=\"zh\">8.1.2. 任意精度数值</h3>\n</div>\n</div>\n</div>\n<p lang=\"zh\">numeric 可以存储位数非常多的数值，尤其推荐用于货币金额和其他要求精确的数量。numeric 运算会在可能时产生精确结果，例如加法、减法和乘法。不过，与整数类型或下一节介绍的浮点类型相比，numeric 运算非常慢。</p>\n<p lang=\"zh\">下文使用以下术语：numeric 的精度是整个数值的有效数字总数，即小数点两侧数字的总位数；小数位数是小数点右侧小数部分的十进制数字位数。例如，23.5141 的精度为 6，小数位数为 4。整数可以视为小数位数为零。</p>\n<p lang=\"zh\">numeric 列的最大精度和最大小数位数都可以配置。声明 numeric 类型列时使用以下语法：</p>\n<pre class=\"programlisting\">NUMERIC(<em class=\"replaceable\"><code>precision</code></em>, <em class=\"replaceable\"><code>scale</code></em>)\n</pre>\n<p lang=\"zh\">精度必须为正数，小数位数可以为正数或负数，见下文。也可以写为：</p>\n<pre class=\"programlisting\">NUMERIC(<em class=\"replaceable\"><code>precision</code></em>)\n</pre>\n<p lang=\"zh\">选择小数位数为 0。指定：</p>\n<pre class=\"programlisting\">NUMERIC\n</pre>\n<p lang=\"zh\">不指定精度或小数位数时，将创建一个“不受约束的 numeric”列，可存储任意长度的数值，但仍受实现上限约束。这类列不会将输入值强制转换为特定的小数位数，而声明了小数位数的 numeric 列会强制转换为该位数。（SQL 标准要求默认小数位数为 0，即强制采用整数精度。我们认为这样不太实用。如果需要兼容其他数据库，应始终显式指定精度和小数位数。）</p>\n<div class=\"note\">\n<h3 class=\"title\" lang=\"zh\">注意</h3>\n<p lang=\"zh\">numeric 类型声明可显式指定的最大精度为 1000。未限定精度的 numeric 列受表 8.2 所述限制约束。</p>\n</div>\n<p lang=\"zh\">如果待存储值的小数位数大于列声明的小数位数，系统会将该值舍入到指定的小数位数。随后，如果小数点左侧的位数超过声明精度减去声明小数位数的结果，就会报错。例如，声明为下列形式的列：</p>\n<pre class=\"programlisting\">NUMERIC(3, 1)\n</pre>\n<p lang=\"zh\">会将值舍入到 1 位小数，并可存储 -99.9 至 99.9 之间的值，包含两端。</p>\n<p lang=\"zh\">从 PostgreSQL 15 开始，允许声明小数位数为负的 numeric 列。此时，数值会在小数点左侧进行舍入。精度仍表示未被舍入部分的最大位数。因此，声明为下列形式的列：</p>\n<pre class=\"programlisting\">NUMERIC(2, -3)\n</pre>\n<p lang=\"zh\">会将值舍入到最接近的千位，并可存储 -99000 至 99000 之间的值，包含两端。还允许声明大于精度的小数位数。这样的列只能保存小数值，并要求小数点右侧紧接的零的位数，至少为声明的小数位数减去声明的精度。例如，声明为下列形式的列：</p>\n<pre class=\"programlisting\">NUMERIC(3, 5)\n</pre>\n<p lang=\"zh\">会将值舍入到 5 位小数，并可存储 -0.00999 至 0.00999 之间的值，包含两端。</p>\n<div class=\"note\">\n<h3 class=\"title\" lang=\"zh\">注意</h3>\n<p lang=\"zh\">PostgreSQL 允许 numeric 类型声明中的小数位数为 -1000 到 1000 之间的任意值。但 SQL 标准要求它介于 0 和精度之间。使用此范围以外的小数位数，可能无法移植到其他数据库系统。</p>\n</div>\n<p lang=\"zh\">numeric 值在物理存储时不会保留多余的前导零或尾随零。因此，列声明的精度与小数位数是最大限制，而非固定分配的空间。（从这一点看，numeric 更像 varchar(n)，而非 char(n)。）实际存储每四位十进制数字需要两个字节，另加三到八个字节的开销。</p>\n<p lang=\"zh\">除普通数值外，numeric 类型还有几个特殊值：</p>\n<div class=\"literallayout\">\n<p><br/>\n<code class=\"literal\">Infinity</code><br/>\n<code class=\"literal\">-Infinity</code><br/>\n<code class=\"literal\">NaN</code><br/></p>\n</div>\n<p lang=\"zh\">这些值取自 IEEE 754 标准，分别表示“正无穷”“负无穷”和“非数”。在 SQL 命令中将它们写成常量时，必须加引号，例如 UPDATE table SET x = '-Infinity'。输入识别时不区分大小写，无穷值也可写为 inf 和 -inf。</p>\n<p lang=\"zh\">无穷值遵循数学上的预期。例如，Infinity 加任意有限值仍为 Infinity，Infinity 加 Infinity 也如此；但 Infinity 减 Infinity 得到 NaN（非数），因为此运算没有明确的数学含义。无穷值只能存储在未限定精度的 numeric 列中，因为从概念上说，它超出了任何有限精度限制。</p>\n<p lang=\"zh\">NaN（非数）用于表示未定义的计算结果。通常，输入包含 NaN 的运算会产生另一个 NaN。唯一例外是：在其他输入不变的情况下，如果将 NaN 替换为任意有限或无限数值都会得到相同结果，那么对 NaN 也返回该结果。（例如，NaN 的零次方为一。）</p>\n<div class=\"note\">\n<h3 class=\"title\" lang=\"zh\">注意</h3>\n<p lang=\"zh\">在“非数值”概念的大多数实现中，NaN 不被视为与任何其他数值相等（包括 NaN）。为了使数值能够排序并用于树形索引，PostgreSQL 将 NaN 值视为彼此相等，且大于所有非 NaN 值。</p>\n</div>\n<p lang=\"zh\">decimal 和 numeric 等价，两者都属于 SQL 标准。</p>\n<p lang=\"zh\">舍入恰好处于中点的值时，numeric 向远离零的方向舍入，而 real 和 double precision 在大多数机器上向最近的偶数舍入。例如：</p>\n<pre class=\"programlisting\">SELECT x,\n  round(x::numeric) AS num_round,\n  round(x::double precision) AS dbl_round\nFROM generate_series(-3.5, 3.5, 1) as x;\n  x   | num_round | dbl_round\n------+-----------+-----------\n -3.5 |        -4 |        -4\n -2.5 |        -3 |        -2\n -1.5 |        -2 |        -2\n -0.5 |        -1 |        -0\n  0.5 |         1 |         0\n  1.5 |         2 |         2\n  2.5 |         3 |         2\n  3.5 |         4 |         4\n(8 rows)\n</pre>\n</div>\n<div class=\"sect2\" id=\"DATATYPE-FLOAT\">\n<div class=\"titlepage\">\n<div>\n<div>\n<h3 class=\"title\" lang=\"zh\">8.1.3. 浮点类型</h3>\n</div>\n</div>\n</div>\n<p lang=\"zh\">real 和 double precision 是非精确、可变精度的数值类型。在当前支持的所有平台上，在底层处理器、操作系统和编译器支持的范围内，它们分别实现 IEEE 754 二进制浮点运算标准的单精度和双精度格式。</p>\n<p lang=\"zh\">不精确意味着某些值无法精确转换为内部格式，只能存储为近似值，因此存储后再取出时可能出现细微差异。如何处理这些误差及其在计算中的传播，是数学和计算机科学中的一个完整分支，此处不作展开，仅说明以下几点：</p>\n<div class=\"itemizedlist\">\n<ul class=\"itemizedlist\">\n<li class=\"listitem\" lang=\"zh\">如果需要精确存储和计算（例如处理货币金额），请改用 numeric 类型。</li>\n<li class=\"listitem\" lang=\"zh\">如果要使用这些类型进行重要的复杂计算，尤其是依赖边界情况（无穷大、下溢）的特定行为时，应仔细评估其实现。</li>\n<li class=\"listitem\" lang=\"zh\">比较两个浮点值是否相等，结果可能并不总是符合预期。</li>\n</ul>\n</div>\n<p lang=\"zh\">在当前支持的所有平台上，real 的取值范围约为 1E-37 到 1E+37，精度至少为 6 位十进制数字。double precision 的取值范围约为 1E-307 到 1E+308，精度至少为 15 位。值过大或过小都会报错；输入精度过高时可能发生舍入。过于接近零、无法表示为区别于零的数值时，会报下溢错误。</p>\n<p lang=\"zh\">默认情况下，浮点值以最短的精确十进制表示形式输出为文本；生成的十进制值与实际存储的二进制值之间的距离，小于它与相同二进制精度下任何其他可表示值之间的距离。（不过，目前输出值绝不会恰好位于两个可表示值的正中间，以避开输入例程未正确遵守舍入到最近偶数规则这一常见缺陷。）对于 float8 值，这种表示最多使用 17 位十进制有效数字；对于 float4 值，最多使用 9 位。</p>\n<div class=\"note\">\n<h3 class=\"title\" lang=\"zh\">注意</h3>\n<p lang=\"zh\">这种最短精确输出格式的生成速度，远高于历史上使用的舍入格式。</p>\n</div>\n<p lang=\"zh\">为兼容旧版 PostgreSQL 生成的输出，并允许降低输出精度，可以使用 extra_float_digits 参数改为选择舍入后的十进制输出。设置为 0 会恢复此前的默认行为，将值舍入为 6 位（float4）或 15 位（float8）十进制有效数字。负值会进一步减少位数；例如，-2 会分别将输出舍入为 4 位或 13 位。</p>\n<p lang=\"zh\">任何大于 0 的 extra_float_digits 值都会选择最短精确格式。</p>\n<div class=\"note\">\n<h3 class=\"title\" lang=\"zh\">注意</h3>\n<p lang=\"zh\">过去，需要精确值的应用必须将 extra_float_digits 设为 3 才能获得这些值。为了最大限度地兼容不同版本，它们应继续这样设置。</p>\n</div>\n<p lang=\"zh\">除普通数值外，浮点类型还有几个特殊值：</p>\n<div class=\"literallayout\">\n<p><br/>\n<code class=\"literal\">Infinity</code><br/>\n<code class=\"literal\">-Infinity</code><br/>\n<code class=\"literal\">NaN</code><br/></p>\n</div>\n<p lang=\"zh\">这些值分别表示 IEEE 754 特殊值“正无穷”“负无穷”和“非数”。在 SQL 命令中将它们写成常量时，必须加引号，例如 UPDATE table SET x = '-Infinity'。输入识别时不区分大小写，无穷值也可写为 inf 和 -inf。</p>\n<div class=\"note\">\n<h3 class=\"title\" lang=\"zh\">注意</h3>\n<p lang=\"zh\">IEEE 754 规定，NaN 不应与任何其他浮点值相等（包括 NaN）。为了使浮点值能够排序并用于树形索引，PostgreSQL 将 NaN 值视为彼此相等，且大于所有非 NaN 值。</p>\n</div>\n<p lang=\"zh\">PostgreSQL 也支持 SQL 标准的 float 和 float(p) 记法来指定非精确数值类型。p 表示可接受的最小二进制位精度。float(1) 到 float(24) 选择 real 类型，float(25) 到 float(53) 选择 double precision。p 超出允许范围会报错；不指定精度的 float 等同于 double precision。</p>\n</div>\n<div class=\"sect2\" id=\"DATATYPE-SERIAL\">\n<div class=\"titlepage\">\n<div>\n<div>\n<h3 class=\"title\" lang=\"zh\">8.1.4. 序列类型</h3>\n</div>\n</div>\n</div>\n<div class=\"note\">\n<h3 class=\"title\" lang=\"zh\">注意</h3>\n<p lang=\"zh\">本节介绍 PostgreSQL 特有的自动递增列创建方法。另一种方法是使用 SQL 标准的标识列特性，参见<a class=\"xref\" href=\"/docs/18/ddl-identity-columns.html\" title=\"5.3. 标识列\">第 5.3 节</a>。</p>\n</div>\n<p lang=\"zh\">smallserial、serial 和 bigserial 并非真正的类型，而是用于创建唯一标识符列的便捷记法，类似于其他一些数据库支持的 AUTO_INCREMENT 属性。在当前实现中，指定：</p>\n<pre class=\"programlisting\">CREATE TABLE <em class=\"replaceable\"><code>tablename</code></em> (\n    <em class=\"replaceable\"><code>colname</code></em> SERIAL\n);\n</pre>\n<p lang=\"zh\">等价于指定：</p>\n<pre class=\"programlisting\">CREATE SEQUENCE <em class=\"replaceable\"><code>tablename</code></em>_<em class=\"replaceable\"><code>colname</code></em>_seq AS integer;\nCREATE TABLE <em class=\"replaceable\"><code>tablename</code></em> (\n    <em class=\"replaceable\"><code>colname</code></em> integer NOT NULL DEFAULT nextval('<em class=\"replaceable\"><code>tablename</code></em>_<em class=\"replaceable\"><code>colname</code></em>_seq')\n);\nALTER SEQUENCE <em class=\"replaceable\"><code>tablename</code></em>_<em class=\"replaceable\"><code>colname</code></em>_seq OWNED BY <em class=\"replaceable\"><code>tablename</code></em>.<em class=\"replaceable\"><code>colname</code></em>;\n</pre>\n<p lang=\"zh\">这样就创建了一个 integer 列，并安排由序列生成器提供默认值。NOT NULL 约束保证无法插入空值。（多数情况下还应增加 UNIQUE 或 PRIMARY KEY 约束，防止意外插入重复值，但系统不会自动添加。）最后，序列被标记为归该列所有，因此删除列或表时，序列也会被删除。</p>\n<div class=\"note\">\n<h3 class=\"title\" lang=\"zh\">注意</h3>\n<p lang=\"zh\">由于 smallserial、serial 和 bigserial 使用序列实现，即使从未删除任何行，列中出现的值序列也可能存在“空洞”或间隙。即便包含所分配值的行从未成功插入表列，从序列分配的值仍已被“用掉”。例如，插入事务回滚时就会发生这种情况。详见第 9.17 节的 nextval()。</p>\n</div>\n<p lang=\"zh\">要将序列的下一个值插入 serial 列，应让该列使用默认值。可以在 INSERT 的列列表中省略此列，也可以使用 DEFAULT 关键字。</p>\n<p lang=\"zh\">serial 与 serial4 等价，都会创建 integer 列。bigserial 与 serial8 的工作方式相同，只是创建 bigint 列。如果预计表的整个生命周期内使用的标识符超过 2^31 个，应使用 bigserial。smallserial 与 serial2 也采用相同方式，但创建 smallint 列。</p>\n<p lang=\"zh\">为 serial 列创建的序列会在所属列被删除时自动删除。也可以只删除序列而保留列，但这会强制移除列的默认值表达式。</p>\n</div>\n</div>", "manual_path": "datatype-numeric.html", "localization": {"status": "complete", "sources": [{"url": "/docs/18/datatype-money.html", "method": "same-major semantic node", "sha256": "6a3a18c17225f00376744bdae7a7f782102e9a0cce0bc2491e7669a43283455e", "language": "zh", "matched_nodes": ["#DATATYPE-MONEY/div[2]/div[1]/table[0]/tbody[2]/tr[0]/td[1]"]}, {"url": "/docs/18/datatype-numeric.html", "method": "same-major semantic node", "sha256": "3119f68768634c1b35c2d9fb65ecb989addbdf99d88064c8292f114cf3b2b79d", "language": "zh", "matched_nodes": ["#DATATYPE-NUMERIC/div[10]/div[9]/p[1]", "#DATATYPE-NUMERIC/div[4]/div[1]/table[0]/tbody[2]/tr[0]/td[3]", "#DATATYPE-NUMERIC/div[4]/div[1]/table[0]/tbody[2]/tr[1]/td[3]", "#DATATYPE-NUMERIC/div[4]/div[1]/table[0]/tbody[2]/tr[2]/td[3]", "#DATATYPE-NUMERIC/div[4]/div[1]/table[0]/tbody[2]/tr[3]/td[1]", "#DATATYPE-NUMERIC/div[4]/div[1]/table[0]/thead[1]/tr[0]/th[0]", "#DATATYPE-NUMERIC/div[8]/div[13]/h3[0]"]}], "language": "zh", "original_text": {"/versions/18/description/0": "exact numeric of selectable precision", "/versions/18/facts/0/label": "Catalog name", "/versions/18/facts/1/label": "Type OID", "/versions/18/facts/2/label": "Type kind", "/versions/18/facts/2/value": "Base type", "/versions/18/facts/3/label": "Declared length", "/versions/18/facts/3/value": "Variable length (varlena)", "/versions/18/facts/4/label": "Storage strategy", "/versions/18/facts/5/label": "Input function", "/versions/18/facts/6/label": "Output function", "/versions/18/facts/7/label": "Documented declaration", "/versions/18/facts/8/label": "Storage Size", "/versions/18/facts/8/value": "variable", "/versions/18/facts/9/label": "Manual description", "/versions/18/facts/9/value": "user-specified precision, exact", "/versions/18/facts/10/label": "Range", "/versions/18/facts/10/value": "up to 131072 digits before the decimal point; up to 16383 digits after the decimal point", "/versions/18/facts/11/label": "Documented declaration", "/versions/18/related/0/label": "pg_type catalog", "/versions/18/related/1/label": "pg_cast catalog", "/versions/18/related/2/label": "pg_operator catalog", "/versions/18/related/3/label": "pg_opclass catalog", "/versions/18/related/4/label": "Arrays", "/versions/18/related/5/label": "brin index access method", "/versions/18/related/6/label": "btree index access method", "/versions/18/related/7/label": "hash index access method"}, "fallback_fields": [], "source_language": "en", "original_snapshot_sha256": "ec76067b5a949fbe0baf2207b27475603a6127c7b3d2952d0216db6a38b559ad"}, "comparison_data": {"casts": [{"castfunc": "int2(numeric)", "castmethod": "f", "castsource": "numeric", "casttarget": "int2", "castcontext": "a"}, {"castfunc": "int4(numeric)", "castmethod": "f", "castsource": "numeric", "casttarget": "int4", "castcontext": "a"}, {"castfunc": "int8(numeric)", "castmethod": "f", "castsource": "numeric", "casttarget": "int8", "castcontext": "a"}, {"castfunc": "money(numeric)", "castmethod": "f", "castsource": "numeric", "casttarget": "money", "castcontext": "a"}, {"castfunc": "numeric(float4)", "castmethod": "f", "castsource": "float4", "casttarget": "numeric", "castcontext": "a"}, {"castfunc": "numeric(float8)", "castmethod": "f", "castsource": "float8", "casttarget": "numeric", "castcontext": "a"}, {"castfunc": "numeric(money)", "castmethod": "f", "castsource": "money", "casttarget": "numeric", "castcontext": "a"}, {"castfunc": "numeric(jsonb)", "castmethod": "f", "castsource": "jsonb", "casttarget": "numeric", "castcontext": "e"}, {"castfunc": "float4(numeric)", "castmethod": "f", "castsource": "numeric", "casttarget": "float4", "castcontext": "i"}, {"castfunc": "float8(numeric)", "castmethod": "f", "castsource": "numeric", "casttarget": "float8", "castcontext": "i"}, {"castfunc": "numeric(int2)", "castmethod": "f", "castsource": "int2", "casttarget": "numeric", "castcontext": "i"}, {"castfunc": "numeric(int4)", "castmethod": "f", "castsource": "int4", "casttarget": "numeric", "castcontext": "i"}, {"castfunc": "numeric(int8)", "castmethod": "f", "castsource": "int8", "casttarget": "numeric", "castcontext": "i"}, {"castfunc": "numeric(numeric,int4)", "castmethod": "f", "castsource": "numeric", "casttarget": "numeric", "castcontext": "i"}], "facts": [{"label": "Catalog name", "value": "pg_catalog.numeric"}, {"label": "Declared length", "value": "Variable length (varlena)"}, {"label": "Documented declaration", "value": "decimal"}, {"label": "Documented declaration", "value": "numeric"}, {"label": "Input function", "value": "numeric_in"}, {"label": "Output function", "value": "numeric_out"}, {"label": "Range", "value": "up to 131072 digits before the decimal point; up to 16383 digits after the decimal point"}, {"label": "Storage Size", "value": "variable"}, {"label": "Storage strategy", "value": "main"}, {"label": "Type OID", "value": "1700"}, {"label": "Type kind", "value": "Base type"}], "ranges": [], "aliases": ["decimal [ ( p , s ) ]"], "catalog": {"typacl": "_null_", "typlen": "-1", "typelem": "0", "typname": "numeric", "typsend": "numeric_send", "typtype": "b", "typalign": "i", "typarray": "_numeric", "typbyval": "f", "typdelim": ",", "typinput": "numeric_in", "typmodin": "numerictypmodin", "typndims": "0", "typrelid": "0", "typmodout": "numerictypmodout", "typoutput": "numeric_out", "typtypmod": "-1", "typanalyze": "-", "typdefault": "_null_", "typnotnull": "f", "typreceive": "numeric_recv", "typstorage": "m", "typbasetype": "0", "typcategory": "N", "typcollation": "0", "typisdefined": "t", "typsubscript": "-", "typdefaultbin": "_null_", "typispreferred": "f", "array_type_name": "_numeric"}, "operators": [{"oprcom": "0", "oprcode": "numeric_abs", "oprjoin": "-", "oprkind": "l", "oprleft": "0", "oprname": "@", "oprrest": "-", "oprright": "numeric", "oprnegate": "0", "oprresult": "numeric", "oprcanhash": "f", "oprcanmerge": "f"}, {"oprcom": "+(numeric,numeric)", "oprcode": "numeric_add", "oprjoin": "-", "oprkind": "b", "oprleft": "numeric", "oprname": "+", "oprrest": "-", "oprright": "numeric", "oprnegate": "0", "oprresult": "numeric", "oprcanhash": "f", "oprcanmerge": "f"}, {"oprcom": "0", "oprcode": "numeric_div", "oprjoin": "-", "oprkind": "b", "oprleft": "numeric", "oprname": "/", "oprrest": "-", "oprright": "numeric", "oprnegate": "0", "oprresult": "numeric", "oprcanhash": "f", "oprcanmerge": "f"}, {"oprcom": "<=(numeric,numeric)", "oprcode": "numeric_ge", "oprjoin": "scalargejoinsel", "oprkind": "b", "oprleft": "numeric", "oprname": ">=", "oprrest": "scalargesel", "oprright": "numeric", "oprnegate": "<(numeric,numeric)", "oprresult": "bool", "oprcanhash": "f", "oprcanmerge": "f"}, {"oprcom": "<(numeric,numeric)", "oprcode": "numeric_gt", "oprjoin": "scalargtjoinsel", "oprkind": "b", "oprleft": "numeric", "oprname": ">", "oprrest": "scalargtsel", "oprright": "numeric", "oprnegate": "<=(numeric,numeric)", "oprresult": "bool", "oprcanhash": "f", "oprcanmerge": "f"}, {"oprcom": ">=(numeric,numeric)", "oprcode": "numeric_le", "oprjoin": "scalarlejoinsel", "oprkind": "b", "oprleft": "numeric", "oprname": "<=", "oprrest": "scalarlesel", "oprright": "numeric", "oprnegate": ">(numeric,numeric)", "oprresult": "bool", "oprcanhash": "f", "oprcanmerge": "f"}, {"oprcom": ">(numeric,numeric)", "oprcode": "numeric_lt", "oprjoin": "scalarltjoinsel", "oprkind": "b", "oprleft": "numeric", "oprname": "<", "oprrest": "scalarltsel", "oprright": "numeric", "oprnegate": ">=(numeric,numeric)", "oprresult": "bool", "oprcanhash": "f", "oprcanmerge": "f"}, {"oprcom": "0", "oprcode": "numeric_mod", "oprjoin": "-", "oprkind": "b", "oprleft": "numeric", "oprname": "%", "oprrest": "-", "oprright": "numeric", "oprnegate": "0", "oprresult": "numeric", "oprcanhash": "f", "oprcanmerge": "f"}, {"oprcom": "*(numeric,numeric)", "oprcode": "numeric_mul", "oprjoin": "-", "oprkind": "b", "oprleft": "numeric", "oprname": "*", "oprrest": "-", "oprright": "numeric", "oprnegate": "0", "oprresult": "numeric", "oprcanhash": "f", "oprcanmerge": "f"}, {"oprcom": "<>(numeric,numeric)", "oprcode": "numeric_ne", "oprjoin": "neqjoinsel", "oprkind": "b", "oprleft": "numeric", "oprname": "<>", "oprrest": "neqsel", "oprright": "numeric", "oprnegate": "=(numeric,numeric)", "oprresult": "bool", "oprcanhash": "f", "oprcanmerge": "f"}, {"oprcom": "+(pg_lsn,numeric)", "oprcode": "numeric_pl_pg_lsn", "oprjoin": "-", "oprkind": "b", "oprleft": "numeric", "oprname": "+", "oprrest": "-", "oprright": "pg_lsn", "oprnegate": "0", "oprresult": "pg_lsn", "oprcanhash": "f", "oprcanmerge": "f"}, {"oprcom": "0", "oprcode": "numeric_power", "oprjoin": "-", "oprkind": "b", "oprleft": "numeric", "oprname": "^", "oprrest": "-", "oprright": "numeric", "oprnegate": "0", "oprresult": "numeric", "oprcanhash": "f", "oprcanmerge": "f"}, {"oprcom": "0", "oprcode": "numeric_sub", "oprjoin": "-", "oprkind": "b", "oprleft": "numeric", "oprname": "-", "oprrest": "-", "oprright": "numeric", "oprnegate": "0", "oprresult": "numeric", "oprcanhash": "f", "oprcanmerge": "f"}, {"oprcom": "0", "oprcode": "numeric_uminus", "oprjoin": "-", "oprkind": "l", "oprleft": "0", "oprname": "-", "oprrest": "-", "oprright": "numeric", "oprnegate": "0", "oprresult": "numeric", "oprcanhash": "f", "oprcanmerge": "f"}, {"oprcom": "0", "oprcode": "numeric_uplus", "oprjoin": "-", "oprkind": "l", "oprleft": "0", "oprname": "+", "oprrest": "-", "oprright": "numeric", "oprnegate": "0", "oprresult": "numeric", "oprcanhash": "f", "oprcanmerge": "f"}, {"oprcom": "0", "oprcode": "pg_lsn_mii", "oprjoin": "-", "oprkind": "b", "oprleft": "pg_lsn", "oprname": "-", "oprrest": "-", "oprright": "numeric", "oprnegate": "0", "oprresult": "pg_lsn", "oprcanhash": "f", "oprcanmerge": "f"}, {"oprcom": "+(numeric,pg_lsn)", "oprcode": "pg_lsn_pli", "oprjoin": "-", "oprkind": "b", "oprleft": "pg_lsn", "oprname": "+", "oprrest": "-", "oprright": "numeric", "oprnegate": "0", "oprresult": "pg_lsn", "oprcanhash": "f", "oprcanmerge": "f"}, {"oprcom": "=(numeric,numeric)", "oprcode": "numeric_eq", "oprjoin": "eqjoinsel", "oprkind": "b", "oprleft": "numeric", "oprname": "=", "oprrest": "eqsel", "oprright": "numeric", "oprnegate": "<>(numeric,numeric)", "oprresult": "bool", "oprcanhash": "t", "oprcanmerge": "t"}], "operator_classes": [{"opcname": "numeric_bloom_ops", "opcfamily": "brin/numeric_bloom_ops", "opcintype": "numeric", "opcmethod": "brin", "opcdefault": "f", "opckeytype": "numeric"}, {"opcname": "numeric_minmax_multi_ops", "opcfamily": "brin/numeric_minmax_multi_ops", "opcintype": "numeric", "opcmethod": "brin", "opcdefault": "f", "opckeytype": "numeric"}, {"opcname": "numeric_minmax_ops", "opcfamily": "brin/numeric_minmax_ops", "opcintype": "numeric", "opcmethod": "brin", "opcdefault": "t", "opckeytype": "numeric"}, {"opcname": "numeric_ops", "opcfamily": "btree/numeric_ops", "opcintype": "numeric", "opcmethod": "btree", "opcdefault": "t", "opckeytype": "0"}, {"opcname": "numeric_ops", "opcfamily": "hash/numeric_ops", "opcintype": "numeric", "opcmethod": "hash", "opcdefault": "t", "opckeytype": "0"}]}, "comparison_hash": "d3429bd7daa8a9fa326c588ea546fcb688e111fe663b23a3dfff89d0fada55d5", "manual_language": "zh", "operator_classes": [{"oid": "3125", "opcname": "numeric_ops", "opcowner": "POSTGRES", "opcfamily": "btree/numeric_ops", "opcintype": "numeric", "opcmethod": "btree", "oid_symbol": "NUMERIC_BTREE_OPS_OID", "opcdefault": "t", "opckeytype": "0", "opcnamespace": "pg_catalog"}, {"opcname": "numeric_ops", "opcowner": "POSTGRES", "opcfamily": "hash/numeric_ops", "opcintype": "numeric", "opcmethod": "hash", "opcdefault": "t", "opckeytype": "0", "opcnamespace": "pg_catalog"}, {"opcname": "numeric_minmax_ops", "opcowner": "POSTGRES", "opcfamily": "brin/numeric_minmax_ops", "opcintype": "numeric", "opcmethod": "brin", "opcdefault": "t", "opckeytype": "numeric", "opcnamespace": "pg_catalog"}, {"opcname": "numeric_minmax_multi_ops", "opcowner": "POSTGRES", "opcfamily": "brin/numeric_minmax_multi_ops", "opcintype": "numeric", "opcmethod": "brin", "opcdefault": "f", "opckeytype": "numeric", "opcnamespace": "pg_catalog"}, {"opcname": "numeric_bloom_ops", "opcowner": "POSTGRES", "opcfamily": "brin/numeric_bloom_ops", "opcintype": "numeric", "opcmethod": "brin", "opcdefault": "f", "opckeytype": "numeric", "opcnamespace": "pg_catalog"}], "manual_documentation": "dedicated family chapter"}, "from": "17", "comparison": {"available": true, "changes": [], "prose_changed": true}}