From c4b51bcd02463cb58e45836be0bd21a547ad9cf9 Mon Sep 17 00:00:00 2001
From: Peter Smith <peter.b.smith@fujitsu.com>
Date: Mon, 29 Jun 2026 10:29:38 +1200
Subject: [PATCH v2] DOCS - Make DDL function table alphabetical and add links

---
 doc/src/sgml/func/func-info.sgml | 81 +++++++++++++++++---------------
 1 file changed, 42 insertions(+), 39 deletions(-)

diff --git a/doc/src/sgml/func/func-info.sgml b/doc/src/sgml/func/func-info.sgml
index bc80bcbd0b3..69ef3857cfa 100644
--- a/doc/src/sgml/func/func-info.sgml
+++ b/doc/src/sgml/func/func-info.sgml
@@ -3874,6 +3874,34 @@ acl      | {postgres=arwdDxtm/postgres,foo=r/postgres}
      </thead>
 
      <tbody>
+      <row>
+       <entry role="func_table_entry"><para role="func_signature">
+        <indexterm>
+         <primary>pg_get_database_ddl</primary>
+        </indexterm>
+        <function>pg_get_database_ddl</function>
+        ( <parameter>database</parameter> <type>regdatabase</type>
+        <optional>, <parameter>pretty</parameter> <type>boolean</type>
+        <literal>DEFAULT</literal> false</optional>
+        <optional>, <parameter>owner</parameter> <type>boolean</type>
+        <literal>DEFAULT</literal> true</optional>
+        <optional>, <parameter>tablespace</parameter> <type>boolean</type>
+        <literal>DEFAULT</literal> true</optional> )
+        <returnvalue>setof text</returnvalue>
+       </para>
+       <para>
+        Reconstructs the <link linkend="sql-createdatabase"><command>CREATE
+        DATABASE</command></link> statement for the specified database,
+        followed by <link linkend="sql-alterdatabase"><command>ALTER DATABASE
+        </command></link> statements for connection limit, template status,
+        and configuration settings.  Each statement is returned as a separate
+        row. When <parameter>pretty</parameter> is true, the output is
+        pretty-printed.  When <parameter>owner</parameter> is false, the
+        <literal>OWNER</literal> clause is omitted.  When
+        <parameter>tablespace</parameter> is false, the
+        <literal>TABLESPACE</literal> clause is omitted.
+       </para></entry>
+      </row>
       <row>
        <entry role="func_table_entry"><para role="func_signature">
         <indexterm>
@@ -3888,14 +3916,15 @@ acl      | {postgres=arwdDxtm/postgres,foo=r/postgres}
         <returnvalue>setof text</returnvalue>
        </para>
        <para>
-        Reconstructs the <command>CREATE ROLE</command> statement and any
-        <command>ALTER ROLE ... SET</command> statements for the given role.
-        Each statement is returned as a separate row.
+        Reconstructs the <link linkend="sql-createrole"><command>CREATE ROLE
+        </command></link> statement and any <link linkend="sql-alterrole">
+        <command>ALTER ROLE ... SET</command></link> statements for the given
+        role.  Each statement is returned as a separate row.
         Password information is never included in the output.
         When <parameter>pretty</parameter> is true, the output is
         pretty-printed.  When <parameter>memberships</parameter> is false,
-        <command>GRANT</command> statements for role memberships are
-        omitted.
+        <link linkend="sql-grant"><command>GRANT</command></link> statements
+        for role memberships are omitted.
        </para></entry>
       </row>
       <row>
@@ -3921,40 +3950,14 @@ acl      | {postgres=arwdDxtm/postgres,foo=r/postgres}
         <returnvalue>setof text</returnvalue>
        </para>
        <para>
-        Reconstructs the <command>CREATE TABLESPACE</command> statement for
-        the specified tablespace (by OID or name).  If the tablespace has
-        options set, an <command>ALTER TABLESPACE ... SET</command> statement
-        is also returned.  Each statement is returned as a separate row.
-        When <parameter>pretty</parameter> is true, the output is
-        pretty-printed.  When <parameter>owner</parameter> is false, the
-        <literal>OWNER</literal> clause is omitted.
-       </para></entry>
-      </row>
-      <row>
-       <entry role="func_table_entry"><para role="func_signature">
-        <indexterm>
-         <primary>pg_get_database_ddl</primary>
-        </indexterm>
-        <function>pg_get_database_ddl</function>
-        ( <parameter>database</parameter> <type>regdatabase</type>
-        <optional>, <parameter>pretty</parameter> <type>boolean</type>
-        <literal>DEFAULT</literal> false</optional>
-        <optional>, <parameter>owner</parameter> <type>boolean</type>
-        <literal>DEFAULT</literal> true</optional>
-        <optional>, <parameter>tablespace</parameter> <type>boolean</type>
-        <literal>DEFAULT</literal> true</optional> )
-        <returnvalue>setof text</returnvalue>
-       </para>
-       <para>
-        Reconstructs the <command>CREATE DATABASE</command> statement for the
-        specified database, followed by <command>ALTER DATABASE</command>
-        statements for connection limit, template status, and configuration
-        settings.  Each statement is returned as a separate row.
-        When <parameter>pretty</parameter> is true, the output is
-        pretty-printed.  When <parameter>owner</parameter> is false, the
-        <literal>OWNER</literal> clause is omitted.  When
-        <parameter>tablespace</parameter> is false, the
-        <literal>TABLESPACE</literal> clause is omitted.
+        Reconstructs the <link linkend="sql-createtablespace"><command>CREATE
+        TABLESPACE</command></link> statement for the specified tablespace (by
+        OID or name).  If the tablespace has options set, an
+        <link linkend="sql-altertablespace"><command>ALTER TABLESPACE ... SET
+        </command></link> statement is also returned.  Each statement is
+        returned as a separate row.  When <parameter>pretty</parameter> is
+        true, the output is pretty-printed.  When <parameter>owner</parameter>
+        is false, the <literal>OWNER</literal> clause is omitted.
        </para></entry>
       </row>
      </tbody>
-- 
2.47.3

