Re: pg_stat_database.xact_commit + pg_stat_database.xact_rollback asa reliable metric for xid consumption ? - Mailing list pgsql-admin

From Rui DeSousa
Subject Re: pg_stat_database.xact_commit + pg_stat_database.xact_rollback asa reliable metric for xid consumption ?
Date
Msg-id FD31C3C1-C1A3-4D93-9971-A45E9B5B5D1D@crazybean.net
Whole thread Raw
In response to Re: pg_stat_database.xact_commit + pg_stat_database.xact_rollback asa reliable metric for xid consumption ?  (Achilleas Mantzios <achill@matrix.gatewaynet.com>)
List pgsql-admin

> On Jun 1, 2020, at 2:16 PM, Achilleas Mantzios <achill@matrix.gatewaynet.com> wrote:
>
>>
>> coalesce(txid_current_if_assigned(), txid_snapshot_xmax(txid_current_snapshot())) as xact_txid, …
> if this is in the same system, and this _hist table only gets inserts, selects/delets, why not just use xmin ? Also
sinceyou are inserting how can you have null  txid_current_if_assigned()? 
>>
>>
>>

Because when exporting the data it’s a readonly transaction and current_txid will be null.  I normally use export on
theprimary and replicas which can’t do inserts.  I create the hist_ tables and insert locally for a standalone
instance.


pgsql-admin by date:

Previous
From: Achilleas Mantzios
Date:
Subject: Re: pg_stat_database.xact_commit + pg_stat_database.xact_rollback asa reliable metric for xid consumption ?
Next
From: vinod kale
Date:
Subject: Block corruption Error.