Re: Add last_commit_lsn to pg_stat_database

From: Tomas Vondra <tomas(dot)vondra(at)enterprisedb(dot)com>
To: James Coleman <jtc331(at)gmail(dot)com>, Peter Smith <smithpb2250(at)gmail(dot)com>
Cc: vignesh C <vignesh21(at)gmail(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Add last_commit_lsn to pg_stat_database
Date: 2024-02-18 01:28:06
Message-ID: 1830997c-b6bc-49eb-bc64-c7f667c91631@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message jian he 2024-02-18 01:30:44 Re: Add pg_basetype() function to obtain a DOMAIN base type
Previous Message Andres Freund 2024-02-18 01:03:13 Re: PGC_SIGHUP shared_buffers?