Home Explore Blog CI



postgresql

62th chunk of `doc/src/sgml/monitoring.sgml`
f03463195611df504397cd166abad74aaa2e455a5e0cc4c90000000100000fa0
 <row>
       <entry role="func_table_entry"><para role="func_signature">
        <indexterm>
         <primary>pg_stat_get_backend_dbid</primary>
        </indexterm>
        <function>pg_stat_get_backend_dbid</function> ( <type>integer</type> )
        <returnvalue>oid</returnvalue>
       </para>
       <para>
        Returns the OID of the database this backend is connected to.
       </para></entry>
      </row>

      <row>
       <entry role="func_table_entry"><para role="func_signature">
        <indexterm>
         <primary>pg_stat_get_backend_idset</primary>
        </indexterm>
        <function>pg_stat_get_backend_idset</function> ()
        <returnvalue>setof integer</returnvalue>
       </para>
       <para>
        Returns the set of currently active backend ID numbers.
       </para></entry>
      </row>

      <row>
       <entry role="func_table_entry"><para role="func_signature">
        <indexterm>
         <primary>pg_stat_get_backend_pid</primary>
        </indexterm>
        <function>pg_stat_get_backend_pid</function> ( <type>integer</type> )
        <returnvalue>integer</returnvalue>
       </para>
       <para>
        Returns the process ID of this backend.
       </para></entry>
      </row>

      <row>
       <entry role="func_table_entry"><para role="func_signature">
        <indexterm>
         <primary>pg_stat_get_backend_start</primary>
        </indexterm>
        <function>pg_stat_get_backend_start</function> ( <type>integer</type> )
        <returnvalue>timestamp with time zone</returnvalue>
       </para>
       <para>
        Returns the time when this process was started.
       </para></entry>
      </row>

      <row>
       <entry role="func_table_entry"><para role="func_signature">
        <indexterm>
         <primary>pg_stat_get_backend_subxact</primary>
        </indexterm>
        <function>pg_stat_get_backend_subxact</function> ( <type>integer</type> )
        <returnvalue>record</returnvalue>
       </para>
       <para>
        Returns a record of information about the subtransactions of the
        backend with the specified ID.
        The fields returned are <parameter>subxact_count</parameter>, which
        is the number of subtransactions in the backend's subtransaction cache,
        and <parameter>subxact_overflow</parameter>, which indicates whether
        the backend's subtransaction cache is overflowed or not.
       </para></entry>
      </row>

      <row>
       <entry role="func_table_entry"><para role="func_signature">
        <indexterm>
         <primary>pg_stat_get_backend_userid</primary>
        </indexterm>
        <function>pg_stat_get_backend_userid</function> ( <type>integer</type> )
        <returnvalue>oid</returnvalue>
       </para>
       <para>
        Returns the OID of the user logged into this backend.
       </para></entry>
      </row>

      <row>
       <entry role="func_table_entry"><para role="func_signature">
        <indexterm>
         <primary>pg_stat_get_backend_wait_event</primary>
        </indexterm>
        <function>pg_stat_get_backend_wait_event</function> ( <type>integer</type> )
        <returnvalue>text</returnvalue>
       </para>
       <para>
        Returns the wait event name if this backend is currently waiting,
        otherwise NULL. See <xref linkend="wait-event-activity-table"/> through
        <xref linkend="wait-event-timeout-table"/>.
       </para></entry>
      </row>

      <row>
       <entry role="func_table_entry"><para role="func_signature">
        <indexterm>
         <primary>pg_stat_get_backend_wait_event_type</primary>
        </indexterm>
        <function>pg_stat_get_backend_wait_event_type</function> ( <type>integer</type> )
        <returnvalue>text</returnvalue>
       </para>
       <para>
        Returns the wait event type name if this backend is currently waiting,
        otherwise NULL.  See <xref linkend="wait-event-table"/> for details.
       </para></entry>
      </row>

      <row>
 

Title: More Per-Backend Statistics Functions in PostgreSQL
Summary
This section continues listing per-backend statistics functions in PostgreSQL, building upon the previously described functions. The functions covered include `pg_stat_get_backend_pid` (returns the process ID), `pg_stat_get_backend_start` (returns the process start time), `pg_stat_get_backend_subxact` (returns information about subtransactions), `pg_stat_get_backend_userid` (returns the user OID), `pg_stat_get_backend_wait_event` (returns the wait event name, if waiting), and `pg_stat_get_backend_wait_event_type` (returns the wait event type name, if waiting).