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

Examples

Basic usage example for pg_current_snapshot():

postgres=# SELECT pg_current_snapshot();
 pg_current_snapshot 
---------------------
 795:799:795,797
(1 row)

Categories

System function, Transactions

See also

pg_snapshot_xmin(), pg_snapshot_xmax(), pg_snapshot_xip(), pg_export_snapshot()