PostgreSQL: Documentation: 17: 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. If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requir
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…
saved by
related reading
- Postgres WAL Files and Sequence Numbers | Crunchy Data Blogcrunchydata.com
- Exploring versions of the Postgres logical replication protocolblog.peerdb.io
- Overcoming Pitfalls of Postgres Logical Decodingblog.peerdb.io
- Patching the PostgreSQL JDBC Driverengineering.zalando.com
- PostgreSQL: Documentation: 18: 54.5. Logical Streaming Replication Protocolpostgresql.org
- 28.3. Write-Ahead Logging (WAL)postgresql.org
- 67.4. Two-Phase Transactionspostgresql.org
- debezium-examples/postgres-toast at main · debezium/debezium-examplesgithub.com
- PostgreSQL: Documentation: 18: 54.1. Overviewpostgresql.org
- PostgreSQL CDC - RisingWavedocs.risingwave.com
- Ingest data from self-hosted PostgreSQL | Materialize Documentationmaterialize.com
- Schedule | POSETTE: An Event for Postgres 2024 - Citus Datacitusdata.com