↑↓ 选择↵ 打开⌫ 切换范围完整搜索

PG.CENTER 连接 PostgreSQL 文档、百科与生态知识。由 Pigsty 维护。

Wiki / 数据类型

pg_lsn

PostgreSQL Log Sequence Number

当前阅读 PG 18·选择有来源记录的版本

此版本暂无所选语言的定义,以下显示原始英文内容。

Catalog name
pg_catalog.pg_lsn
Type OID
3220
Type kind
Base type
Declared length
8 bytes
Storage strategy
plain
Input function
pg_lsn_in
Output function
pg_lsn_out
aliases
未知
casts
未知
coverage
source inventory; exact declared input types for operator classes
manual documentation
dedicated family chapter
manual path
datatype-pg-lsn.html
ranges
未知
signature
pg_lsn

版本定义 PG 18

8.20. pg_lsn Type

The pg_lsn data type can be used to store LSN (Log Sequence Number) data which is a pointer to a location in the WAL. This type is a representation of XLogRecPtr and an internal system type of PostgreSQL.

Internally, an LSN is a 64-bit integer, representing a byte position in the write-ahead log stream. It is printed as two hexadecimal numbers of up to 8 digits each, separated by a slash; for example, 16/B374D848. The pg_lsn type supports the standard comparison operators, like = and >. Two LSNs can be subtracted using the - operator; the result is the number of bytes separating those write-ahead log locations. Also the number of bytes can be added into and subtracted from LSN using the +(pg_lsn,numeric) and -(pg_lsn,numeric) operators, respectively. Note that the calculated LSN should be in the range of pg_lsn type, i.e., between 0/0 and FFFFFFFF/FFFFFFFF.

比较版本

完整来源事实

catalog

{"array_type_name":"_pg_lsn","array_type_oid":"3221","descr":"PostgreSQL LSN","oid":"3220","typacl":"_null_","typalign":"d","typanalyze":"-","typarray":"0","typbasetype":"0","typbyval":"FLOAT8PASSBYVAL","typcategory":"U","typcollation":"0","typdefault":"_null_","typdefaultbin":"_null_","typdelim":"','","typelem":"0","typinput":"pg_lsn_in","typisdefined":"t","typispreferred":"f","typlen":"8","typmodin":"-","typmodout":"-","typname":"pg_lsn","typnamespace":"pg_catalog","typndims":"0","typnotnull":"f","typoutput":"pg_lsn_out","typowner":"POSTGRES","typreceive":"pg_lsn_recv","typrelid":"0","typsend":"pg_lsn_send","typstorage":"p","typsubscript":"-","typtype":"b","typtypmod":"-1"}

operator classes

map[opcdefault:t opcfamily:btree/pg_lsn_ops opcintype:pg_lsn opckeytype:0 opcmethod:btree opcname:pg_lsn_ops opcnamespace:pg_catalog opcowner:POSTGRES], map[opcdefault:t opcfamily:hash/pg_lsn_ops opcintype:pg_lsn opckeytype:0 opcmethod:hash opcname:pg_lsn_ops opcnamespace:pg_catalog opcowner:POSTGRES], map[opcdefault:t opcfamily:brin/pg_lsn_minmax_ops opcintype:pg_lsn opckeytype:pg_lsn opcmethod:brin opcname:pg_lsn_minmax_ops opcnamespace:pg_catalog opcowner:POSTGRES], map[opcdefault:f opcfamily:brin/pg_lsn_minmax_multi_ops opcintype:pg_lsn opckeytype:pg_lsn opcmethod:brin opcname:pg_lsn_minmax_multi_ops opcnamespace:pg_catalog opcowner:POSTGRES], map[opcdefault:f opcfamily:brin/pg_lsn_bloom_ops opcintype:pg_lsn opckeytype:pg_lsn opcmethod:brin opcname:pg_lsn_bloom_ops opcnamespace:pg_catalog opcowner:POSTGRES]

operators

map[descr:equal oid:3222 oprcanhash:t oprcanmerge:t oprcode:pg_lsn_eq oprcom:=(pg_lsn,pg_lsn) oprjoin:eqjoinsel oprkind:b oprleft:pg_lsn oprname:= oprnamespace:pg_catalog oprnegate:<>(pg_lsn,pg_lsn) oprowner:POSTGRES oprrest:eqsel oprresult:bool oprright:pg_lsn], map[descr:not equal oid:3223 oprcanhash:f oprcanmerge:f oprcode:pg_lsn_ne oprcom:<>(pg_lsn,pg_lsn) oprjoin:neqjoinsel oprkind:b oprleft:pg_lsn oprname:<> oprnamespace:pg_catalog oprnegate:=(pg_lsn,pg_lsn) oprowner:POSTGRES oprrest:neqsel oprresult:bool oprright:pg_lsn], map[descr:less than oid:3224 oprcanhash:f oprcanmerge:f oprcode:pg_lsn_lt oprcom:>(pg_lsn,pg_lsn) oprjoin:scalarltjoinsel oprkind:b oprleft:pg_lsn oprname:< oprnamespace:pg_catalog oprnegate:>=(pg_lsn,pg_lsn) oprowner:POSTGRES oprrest:scalarltsel oprresult:bool oprright:pg_lsn], map[descr:greater than oid:3225 oprcanhash:f oprcanmerge:f oprcode:pg_lsn_gt oprcom:<(pg_lsn,pg_lsn) oprjoin:scalargtjoinsel oprkind:b oprleft:pg_lsn oprname:> oprnamespace:pg_catalog oprnegate:<=(pg_lsn,pg_lsn) oprowner:POSTGRES oprrest:scalargtsel oprresult:bool oprright:pg_lsn], map[descr:less than or equal oid:3226 oprcanhash:f oprcanmerge:f oprcode:pg_lsn_le oprcom:>=(pg_lsn,pg_lsn) oprjoin:scalarlejoinsel oprkind:b oprleft:pg_lsn oprname:<= oprnamespace:pg_catalog oprnegate:>(pg_lsn,pg_lsn) oprowner:POSTGRES oprrest:scalarlesel oprresult:bool oprright:pg_lsn], map[descr:greater than or equal oid:3227 oprcanhash:f oprcanmerge:f oprcode:pg_lsn_ge oprcom:<=(pg_lsn,pg_lsn) oprjoin:scalargejoinsel oprkind:b oprleft:pg_lsn oprname:>= oprnamespace:pg_catalog oprnegate:<(pg_lsn,pg_lsn) oprowner:POSTGRES oprrest:scalargesel oprresult:bool oprright:pg_lsn], map[descr:minus oid:3228 oprcanhash:f oprcanmerge:f oprcode:pg_lsn_mi oprcom:0 oprjoin:- oprkind:b oprleft:pg_lsn oprname:- oprnamespace:pg_catalog oprnegate:0 oprowner:POSTGRES oprrest:- oprresult:numeric oprright:pg_lsn], map[descr:add oid:5025 oprcanhash:f oprcanmerge:f oprcode:pg_lsn_pli oprcom:+(numeric,pg_lsn) oprjoin:- oprkind:b oprleft:pg_lsn oprname:+ oprnamespace:pg_catalog oprnegate:0 oprowner:POSTGRES oprrest:- oprresult:pg_lsn oprright:numeric], map[descr:add oid:5026 oprcanhash:f oprcanmerge:f oprcode:numeric_pl_pg_lsn oprcom:+(pg_lsn,numeric) oprjoin:- oprkind:b oprleft:numeric oprname:+ oprnamespace:pg_catalog oprnegate:0 oprowner:POSTGRES oprrest:- oprresult:pg_lsn oprright:pg_lsn], map[descr:subtract oid:5027 oprcanhash:f oprcanmerge:f oprcode:pg_lsn_mii oprcom:0 oprjoin:- oprkind:b oprleft:pg_lsn oprname:- oprnamespace:pg_catalog oprnegate:0 oprowner:POSTGRES oprrest:- oprresult:pg_lsn oprright:numeric]

来源引用

完整定义与证据 JSON

定义来源

center · PostgreSQL 18 · 555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f

正文语言: en · 555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f