-- init \set ECHO none -- i/o select '12:13:'::txid_snapshot; txid_snapshot --------------- 12:13: (1 row) select '12:13:1,2'::txid_snapshot; ERROR: illegal txid_snapshot input format -- errors select '31:12:'::txid_snapshot; ERROR: illegal txid_snapshot input format select '0:1:'::txid_snapshot; ERROR: illegal txid_snapshot input format select '12:13:0'::txid_snapshot; ERROR: illegal txid_snapshot input format select '12:13:2,1'::txid_snapshot; ERROR: illegal txid_snapshot input format create table snapshot_test ( nr integer, snap txid_snapshot ); insert into snapshot_test values (1, '12:13:'); insert into snapshot_test values (2, '12:20:13,15,18'); insert into snapshot_test values (3, '100001:100009:100005,100007,100008'); select snap from snapshot_test order by nr; snap ------------------------------------ 12:13: 12:20:13,15,18 100001:100009:100005,100007,100008 (3 rows) select get_snapshot_xmin(snap), get_snapshot_xmax(snap), get_snapshot_active(snap) from snapshot_test order by nr; get_snapshot_xmin | get_snapshot_xmax | get_snapshot_active -------------------+-------------------+--------------------- 12 | 20 | 13 12 | 20 | 15 12 | 20 | 18 100001 | 100009 | 100005 100001 | 100009 | 100007 100001 | 100009 | 100008 (6 rows) select id, txid_in_snapshot(id, snap), txid_not_in_snapshot(id, snap) from snapshot_test, generate_series(11, 21) id where nr = 2; id | txid_in_snapshot | txid_not_in_snapshot ----+------------------+---------------------- 11 | t | f 12 | t | f 13 | f | t 14 | t | f 15 | f | t 16 | t | f 17 | t | f 18 | f | t 19 | t | f 20 | f | t 21 | f | t (11 rows) -- test current values also select get_current_txid() >= get_snapshot_xmin(get_current_snapshot()); ?column? ---------- t (1 row) select get_current_txid() < get_snapshot_xmax(get_current_snapshot()); ?column? ---------- t (1 row) select txid_in_snapshot(get_current_txid(), get_current_snapshot()), txid_not_in_snapshot(get_current_txid(), get_current_snapshot()); txid_in_snapshot | txid_not_in_snapshot ------------------+---------------------- t | f (1 row)