Thread: How to detect txid visibility on standby server?

How to detect txid visibility on standby server?

From
Sergey Burladyan
Date:
Hello!

Is it possible to detect what master transaction is visible on standby?

I try to use txid_current_snapshot() but it return wrong result on standby:
_master_:
create table tmp.txid_test(txid bigint, ss txid_snapshot)
begin;
insert into tmp.txid_test values (txid_current(), txid_current_snapshot());
select * from tmp.txid_test;
=> 9098493097 '9098489391:9098493097:9098489391,9098493002,9098493088'
        _standby_:
        select txid_visible_in_snapshot(9098493097, txid_current_snapshot());
        => t
        select count(*) from tmp.txid_test;
        => 0

So, txid_visible_in_snapshot say what 9098493097 is visible, but realy it is not, it still not
commited on master and count on standby return 0 rows.

PS: And what does it exactly mean to get txid_current_snapshot() from standby?

-- 
Sergey Burladyan