Thread

Commits

  1. doc: Improve description of pg_get_multixact_stats()

  1. Fix doc about pg_get_multixact_stats()

    Yingying Chen <cyy9255@gmail.com> — 2026-06-25T11:49:58Z

    Hi Hacker,
    
    I found a small documentation issue in func-info.smgl:
    
       <para>
        The internal transaction ID type <type>xid</type> is 32 bits wide and
        wraps around every 4 billion transactions.  However,
        the functions shown in <xref linkend="functions-pg-snapshot"/>, except
        <function>age</function>, <function>mxid_age</function>, and
        <function>pg_get_multixact_members</function>, use a
        64-bit type <type>xid8</type> that does not wrap around during the life
        of an installation and can be converted to <type>xid</type> by casting
    if
        required;  see <xref linkend="transaction-id"/> for details.
    
    Since pg_get_multixact_stats() was added in PG19, it should be added to
    this exception list.
    
    Regards,
    Yingying Chen
    
  2. Re: Fix doc about pg_get_multixact_stats()

    Michael Paquier <michael@paquier.xyz> — 2026-06-25T22:27:03Z

    On Thu, Jun 25, 2026 at 07:49:58PM +0800, Yingying Chen wrote:
    > Since pg_get_multixact_stats() was added in PG19, it should be added to
    > this exception list.
    
    Indeed.  Thanks for the patch.  Will fix.
    --
    Michael
    
  3. Re: Fix doc about pg_get_multixact_stats()

    Chao Li <li.evan.chao@gmail.com> — 2026-06-25T23:15:37Z

    
    > On Jun 26, 2026, at 06:27, Michael Paquier <michael@paquier.xyz> wrote:
    > 
    > On Thu, Jun 25, 2026 at 07:49:58PM +0800, Yingying Chen wrote:
    >> Since pg_get_multixact_stats() was added in PG19, it should be added to
    >> this exception list.
    > 
    > Indeed.  Thanks for the patch.  Will fix.
    > --
    > Michael
    
    While reviewing this patch, I found this statement for pg_get_multixact_stats() is a little misleading or unclear:
    ```
           <para>
            To use this function, you must have privileges of the
            <literal>pg_read_all_stats</literal> role.
           </para></entry>
    ```
    
    From the implementation, for unprivileged (not super user and not pg_read_all_stats role) users, pg_get_multixact_stats doesn't raise an error, but just returns all NULL values. The current statement doesn't seem to explain that behavior clearly.
    
    How about rephrasing it like this?
    ```
          <para>
            Only superusers and roles with privileges of the
            <literal>pg_read_all_stats</literal> role can see details; other users
            receive null values.
          </para></entry>
    ```
    
    Best regards,
    --
    Chao Li (Evan)
    HighGo Software Co., Ltd.
    https://www.highgo.com/
    
    
    
    
    
    
    
    
  4. Re: Fix doc about pg_get_multixact_stats()

    Michael Paquier <michael@paquier.xyz> — 2026-06-25T23:41:39Z

    On Fri, Jun 26, 2026 at 07:15:37AM +0800, Chao Li wrote:
    > From the implementation, for unprivileged (not super user and not
    > pg_read_all_stats role) users, pg_get_multixact_stats doesn't raise
    > an error, but just returns all NULL values. The current statement
    > doesn't seem to explain that behavior clearly.
    > 
    > How about rephrasing it like this?
    > ```
    >       <para>
    >         Only superusers and roles with privileges of the
    >         <literal>pg_read_all_stats</literal> role can see details; other users
    >         receive null values.
    >       </para></entry>
    > ```
    
    Yeah, that looks like an improvement over the statu-quo.  I was
    looking for something similar but we don't have many functions hidden
    behind a role privilege.
    --
    Michael