How to detect txid visibility on standby server?

Поиск
Список
Период
Сортировка
От Sergey Burladyan
Тема How to detect txid visibility on standby server?
Дата
Msg-id CAJ2ymdhN3DVsvhhofA62qhwqBxRuXYOJhTquC4RO4GCd0AXVxQ@mail.gmail.com
обсуждение исходный текст
Список 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 по дате отправления:

Предыдущее
От: Adrian Klaver
Дата:
Сообщение: Re: pgbouncer not finding pidfile
Следующее
От: Kevin Goess
Дата:
Сообщение: free RAM not being used for page cache