Re: Add last_commit_lsn to pg_stat_database - Mailing list pgsql-hackers

From Tomas Vondra
Subject Re: Add last_commit_lsn to pg_stat_database
Date
Msg-id 1830997c-b6bc-49eb-bc64-c7f667c91631@enterprisedb.com
Whole thread Raw
In response to Re: Add last_commit_lsn to pg_stat_database  (James Coleman <jtc331@gmail.com>)
Responses Re: Add last_commit_lsn to pg_stat_database
List pgsql-hackers
Hi James,

Thanks for the updated patch. I don't have a clear opinion on the
feature and whether this is the way to implement it, but I have two
simple questions.

1) Do we really need to modify RecordTransactionCommitPrepared and
XactLogCommitRecord to return the LSN of the commit record? Can't we
just use XactLastRecEnd? It's good enough for advancing
replorigin_session_origin_lsn, why wouldn't it be good enough for this?


2) Earlier in this thread it was claimed the function returning the
last_commit_lsn is STABLE, but I have to admit it's not clear to me why
that's the case :-( All the pg_stat_get_db_* functions are marked as
stable, so I guess it's thanks to the pgstat system ...


regards

-- 
Tomas Vondra
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company



pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: PGC_SIGHUP shared_buffers?
Next
From: jian he
Date:
Subject: Re: Add pg_basetype() function to obtain a DOMAIN base type