How to detect txid visibility on standby server? - Mailing list pgsql-general

From Sergey Burladyan
Subject How to detect txid visibility on standby server?
Date
Msg-id CAJ2ymdhN3DVsvhhofA62qhwqBxRuXYOJhTquC4RO4GCd0AXVxQ@mail.gmail.com
Whole thread Raw
List pgsql-general
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

pgsql-general by date:

Previous
From: Adrian Klaver
Date:
Subject: Re: pgbouncer not finding pidfile
Next
From: Kevin Goess
Date:
Subject: free RAM not being used for page cache