On Wed, Jun 11, 2025 at 9:44 PM Sami Imseih <samims...@gmail.com> wrote:
> > It's not clear, without some effort, which lock mode go with which row > lock in that description. > > For example, "keysh" does not have "for" in it but "fornokeyupd" does. > How about rephrasing this > > as "The lock modes "keysh", "sh", fornokeyupd", and "forupd" correspond > to > > <literal>FOR KEY SHARE</literal>, <literal>FOR SHARE</literal>, > <literal>FOR NO KEY UPDATE</literal>, > > and <literal>FOR UPDATE</literal> row level locks respectively as > described in <xref linkend="locking-rows"/>." > > That works for me. > > > Do we want to add the section "Multixact Information Functions" after > other transaction related > > sections like "Transaction ID and Snapshot Information Function" and > > " Committed Transaction Information Functions" instead of adding it at > the end? > > makes sense. > > Attached patch removing extra comma. Otherwise LGTM. Please add the patch to CF, if not already done and mark it as "ready for committer". -- Best Wishes, Ashutosh Bapat
From dd240a151a5a17f2872d4df0a353e03c73f2daf2 Mon Sep 17 00:00:00 2001 From: Sami Imseih <sims...@amazon.com> Date: Wed, 4 Jun 2025 14:33:38 -0500 Subject: [PATCH] Document pg_get_multixact_members pg_get_multixact_members has widespread usage, yet lacks official documentation in the system functions section. There was a desire to document in the past but it appears to have slipped due to a lack of reviews. Discussion: https://www.postgresql.org/message-id/flat/CAA5RZ0seQ2KyoSxUQ80OS9f8Yphe1Fu-6cSDkVG1so4ko90Q_A%40mail.gmail.com#3458b5b0c79d44b420a469c7309ea77b --- doc/src/sgml/func.sgml | 51 +++++++++++++++++++++++++++++++++++ doc/src/sgml/maintenance.sgml | 4 ++- 2 files changed, 54 insertions(+), 1 deletion(-) diff --git a/doc/src/sgml/func.sgml b/doc/src/sgml/func.sgml index c67688cbf5f..5af113cfc84 100644 --- a/doc/src/sgml/func.sgml +++ b/doc/src/sgml/func.sgml @@ -27955,6 +27955,57 @@ acl | {postgres=arwdDxtm/postgres,foo=r/postgres} </sect2> + <sect2 id="functions-info-multixact"> + <title>Multixact Information Functions</title> + + <para> + The functions shown in <xref linkend="functions-multixact"/> + provide information about multixacts in the system. + </para> + + <table id="functions-multixact"> + <title>Multixact Information Functions</title> + <tgroup cols="1"> + <thead> + <row> + <entry role="func_table_entry"><para role="func_signature"> + Function + </para> + <para> + Description + </para></entry> + </row> + </thead> + + <tbody> + <row> + <entry role="func_table_entry"><para role="func_signature"> + <indexterm> + <primary>pg_get_multixact_members</primary> + </indexterm> + <function>pg_get_multixact_members</function> ( <type>xid</type> ) + <returnvalue>setof record</returnvalue> + ( <parameter>xid</parameter> <type>xid</type>, + <parameter>mode</parameter> <type>text</type> ) + </para> + <para> + Returns the transaction ID and lock mode for each member of the specified + multixact ID. The lock modes <literal>forupd</literal>, <literal>fornokeyupd</literal>, + <literal>sh</literal>, and <literal>keysh</literal> correspond to + the row-level locks <literal>FOR UPDATE</literal>, <literal>FOR NO KEY UPDATE</literal>, + <literal>FOR SHARE</literal> and <literal>FOR KEY SHARE</literal>, respectively, + as described in <xref linkend="locking-rows"/>. Two additional modes are specific to + multixacts: <literal>nokeyupd</literal>, used by updates that do not modify key + columns, and <literal>upd</literal>, used by updates or deletes that modify key + columns. + </para></entry> + </row> + </tbody> + </tgroup> + </table> + + </sect2> + <sect2 id="functions-info-controldata"> <title>Control Data Functions</title> diff --git a/doc/src/sgml/maintenance.sgml b/doc/src/sgml/maintenance.sgml index 600e4b3f2f3..94f75f3da8f 100644 --- a/doc/src/sgml/maintenance.sgml +++ b/doc/src/sgml/maintenance.sgml @@ -779,7 +779,9 @@ HINT: Execute a database-wide VACUUM in that database. careful aging management, storage cleanup, and wraparound handling. There is a separate storage area which holds the list of members in each multixact, which also uses a 32-bit counter and which must also - be managed. + be managed. The system function <function>pg_get_multixact_members()</function> + described in <xref linkend="functions-info-multixact"/> can be used to + examine the transaction IDs associated with a multixact ID. </para> <para> base-commit: f85f6ab051b7cf6950247e5fa6072c4130613555 -- 2.34.1