@@ -320,6 +320,20 @@ postgres 27093 0.0 0.0 30096 2752 ? Ss 11:34 0:00 postgres: ser
320320 </entry>
321321 </row>
322322
323+ <row>
324+ <entry>
325+ <structname>pg_stat_backend_transaction</structname>
326+ <indexterm><primary>pg_stat_backend_transaction</primary></indexterm>
327+ </entry>
328+ <entry>
329+ One row per server process, showing statistics related to
330+ the current activity of that process, such as number of commits and
331+ rollbacks.
332+ See <link linkend="monitoring-pg-stat-backend-transaction-view">
333+ <structname>pg_stat_backend_transaction</structname></link> for details.
334+ </entry>
335+ </row>
336+
323337 <row>
324338 <entry><structname>pg_stat_replication</structname><indexterm><primary>pg_stat_replication</primary></indexterm></entry>
325339 <entry>One row per WAL sender process, showing statistics about
@@ -1172,6 +1186,91 @@ description | Waiting for a newly initialized WAL file to reach durable storage
11721186 </note>
11731187 </sect2>
11741188
1189+ <sect2 id="monitoring-pg-stat-backend-transaction-view">
1190+ <title><structname>pg_stat_backend_transaction</structname></title>
1191+
1192+ <indexterm>
1193+ <primary>pg_stat_backend_transaction</primary>
1194+ </indexterm>
1195+
1196+ <para>
1197+ The <structname>pg_stat_backend_transaction</structname> view will have one row
1198+ per server process, showing statistics related to
1199+ the current activity of that process.
1200+ </para>
1201+
1202+ <table id="pg-stat-backend-transaction-view" xreflabel="pg_stat_backend_transaction">
1203+ <title><structname>pg_stat_backend_transaction</structname> View</title>
1204+ <tgroup cols="1">
1205+ <thead>
1206+ <row>
1207+ <entry role="catalog_table_entry"><para role="column_definition">
1208+ Column Type
1209+ </para>
1210+ <para>
1211+ Description
1212+ </para></entry>
1213+ </row>
1214+ </thead>
1215+
1216+ <tbody>
1217+ <row>
1218+ <entry role="catalog_table_entry"><para role="column_definition">
1219+ <structfield>pid</structfield> <type>integer</type>
1220+ </para>
1221+ <para>
1222+ Process ID of this backend
1223+ </para></entry>
1224+ </row>
1225+
1226+ <row>
1227+ <entry role="catalog_table_entry"><para role="column_definition">
1228+ <structfield>xid_count</structfield> <type>bigint</type>
1229+ </para>
1230+ <para>
1231+ The number of XID that have been generated by the backend. It does not take
1232+ into account virtual transaction ID on purpose.
1233+ </para></entry>
1234+ </row>
1235+
1236+ <row>
1237+ <entry role="catalog_table_entry"><para role="column_definition">
1238+ <structfield>xact_commit</structfield> <type>bigint</type>
1239+ </para>
1240+ <para>
1241+ The number of transactions that have been committed.
1242+ </para></entry>
1243+ </row>
1244+
1245+ <row>
1246+ <entry role="catalog_table_entry"><para role="column_definition">
1247+ <structfield>xact_rollback</structfield> <type>bigint</type>
1248+ </para>
1249+ <para>
1250+ The number of transactions that have been rolled back.
1251+ </para></entry>
1252+ </row>
1253+
1254+ <row>
1255+ <entry role="catalog_table_entry"><para role="column_definition">
1256+ <structfield>stats_reset</structfield> <type>timestamp with time zone</type>
1257+ </para>
1258+ <para>
1259+ Time at which these statistics were last reset
1260+ </para></entry>
1261+ </row>
1262+ </tbody>
1263+ </tgroup>
1264+ </table>
1265+
1266+ <note>
1267+ <para>
1268+ The view does not return statistics for the checkpointer,
1269+ the background writer, the startup process and the autovacuum launcher.
1270+ </para>
1271+ </note>
1272+ </sect2>
1273+
11751274 <sect2 id="monitoring-pg-stat-replication-view">
11761275 <title><structname>pg_stat_replication</structname></title>
11771276
@@ -4990,6 +5089,22 @@ description | Waiting for a newly initialized WAL file to reach durable storage
49905089 </para></entry>
49915090 </row>
49925091
5092+ <row>
5093+ <entry role="func_table_entry"><para role="func_signature">
5094+ <indexterm>
5095+ <primary>pg_stat_get_backend_transactions</primary>
5096+ </indexterm>
5097+ <function>pg_stat_get_backend_transactions</function> ( <type>integer</type> )
5098+ <returnvalue>setof record</returnvalue>
5099+ </para>
5100+ <para>
5101+ Returns a record of transaction statistics about the backend with the
5102+ specified process ID, or one record for each active backend in the system
5103+ if <literal>NULL</literal> is specified. The fields returned are a
5104+ subset of those in the <structname>pg_stat_backend_transaction</structname> view.
5105+ </para></entry>
5106+ </row>
5107+
49935108 <row>
49945109 <entry id="pg-stat-get-backend-wal" role="func_table_entry"><para role="func_signature">
49955110 <indexterm>
0 commit comments