On Wed, Jan 21, 2026 at 03:01:44PM +0530, Akshay Joshi wrote:
> In my previous email, I included two different patches (for two separate
> approaches) from different branches. As a result, CommitFest is indicating
> that a rebase is required.
> 
> Apologies for the inconvenience, I’m still getting familiar with the
> process.
> 
> Attached are the patches, layered one on top of the other, representing two
> approaches:
> 
>    - *Double Dash*:
>    v8-0001-Add-pg_get_database_ddl-function-to-reconstruct-double-dash.patch
>    - *DefElem (Key-Value)*:
>    v8-0002-Add-pg_get_database_ddl-function-to-reconstruct-DefElem.patch
> 
> I am now submitting the *v8 patches*, which are ready for review. Please
> let me know which approach you find more suitable and preferable.

I have some documentation style suggestions that I've also attached as a patch:

* Update the pg_get_database_ddl() definitions in the func-info table to list
  the multiple database way to reference a database, similar to
  pg_database_size()
* Shorten the argument description for OID and name, again similar to
  pg_database_size()'s style
* Shorten ddl_options argument description to simply options, to match the
  style of how other functions in the docs describe optional parameters
* Remove the redundant explanation of the optional parameters in the individual
  function's description, and instead refer the reader to the explanation
  following the table
* Some word choice and phrasing changes in the pg_get_database_ddl function
  description to be grammatically closer to something like
  pg_restore_relation_stats()


I hope that is helpful...

Regards,
Mark
-- 
Mark Wong <[email protected]>
EDB https://enterprisedb.com
diff --git a/doc/src/sgml/func/func-info.sgml b/doc/src/sgml/func/func-info.sgml
index 218578c318f..4fc74ca29a1 100644
--- a/doc/src/sgml/func/func-info.sgml
+++ b/doc/src/sgml/func/func-info.sgml
@@ -3874,20 +3874,21 @@ acl      | {postgres=arwdDxtm/postgres,foo=r/postgres}
         <indexterm>
          <primary>pg_get_database_ddl</primary>
         </indexterm>
-        <function>pg_get_database_ddl</function>
-        ( <parameter>database_id</parameter> <type>regdatabase</type>
-        <optional>, <literal>VARIADIC</literal> <parameter>ddl_options</parameter>
-        <type>text[]</type> </optional> )
+        <function>pg_get_database_ddl</function> ( <type>name</type> <optional>, <literal>VARIADIC</literal> <parameter>options</parameter> <type>text[]</type> </optional> )
+        <returnvalue>text</returnvalue>
+       </para>
+       <para role="func_signature">
+        <indexterm>
+         <primary>pg_get_database_ddl</primary>
+        </indexterm>
+        <function>pg_get_database_ddl</function> ( <type>oid</type> <optional>, <literal>VARIADIC</literal> <parameter>options</parameter> <type>text[]</type> </optional> )
         <returnvalue>text</returnvalue>
        </para>
        <para>
         Reconstructs the <command>CREATE DATABASE</command> statement from the
-        system catalogs for a specified database. The first argument is the OID or
-        name of the database. The optional variadic argument is an array of text
-        flags to control the output. Supported options include
-        <literal>pretty</literal>, <literal>owner=no/false/0</literal>,
-        <literal>tablespace=no/false/0</literal>, and <literal>defaults</literal>
-        Or <literal>defaults=yes</literal>.
+        system catalogs for a specified database by name or OID. The optional
+        variadic argument is an array of arguments to control the output
+        formatting and content. Supported arguments explained below.
         </para></entry>
       </row>
      </tbody>
@@ -3895,8 +3896,8 @@ acl      | {postgres=arwdDxtm/postgres,foo=r/postgres}
    </table>
 
   <para>
-    The <parameter>ddl_options</parameter> for <function>pg_get_database_ddl</function>
-    provide fine-grained control over the generated SQL:
+    The <parameter>options</parameter> for these object DDL functions provide
+    fine-grained control over the generated SQL:
     <itemizedlist>
     <listitem>
       <para>
diff --git a/src/backend/catalog/system_functions.sql b/src/backend/catalog/system_functions.sql
index 16c0d52479a..69a098561e7 100644
--- a/src/backend/catalog/system_functions.sql
+++ b/src/backend/catalog/system_functions.sql
@@ -658,7 +658,7 @@ STRICT VOLATILE PARALLEL UNSAFE
 AS 'pg_replication_origin_session_setup';
 
 CREATE OR REPLACE FUNCTION
-  pg_get_database_ddl(database_id regdatabase, VARIADIC ddl_options text[] DEFAULT '{}')
+  pg_get_database_ddl(database_id regdatabase, VARIADIC options text[] DEFAULT '{}')
 RETURNS text
 LANGUAGE internal
 AS 'pg_get_database_ddl';

Reply via email to