Contents
pg_current_snapshot()
A function returning the current snapshot
pg_current_snapshot()
is a system function returning the current snapshot.
pg_current_snapshot()
was added in PostgreSQL 13.
Usage
pg_current_snapshot () → pg_snapshot
The individual components of the returned pg_snapshot
value can be extracted with the following functions:
pg_current_snapshot()
replaces txid_current_snapshot()
.
Change history
- PostgreSQL 13
- added (commit 4c04be9b)
Examples
Basic usage example for pg_current_snapshot()
:
postgres=# SELECT pg_current_snapshot(); pg_current_snapshot --------------------- 795:799:795,797 (1 row)
References
- PostgreSQL documentation: Transaction ID and Snapshot Information Functions