Re: pg_get__*_ddl consolidation
Euler Taveira <euler@eulerto.com>
From: "Euler Taveira" <euler@eulerto.com>
To: "Andrew Dunstan" <andrew@dunslane.net>, Álvaro Herrera <alvherre@kurilemu.de>, "Zsolt Parragi" <zsolt.parragi@percona.com>, "Japin Li" <japinli@hotmail.com>
Cc: "PostgreSQL Hackers" <pgsql-hackers@lists.postgresql.org>
Date: 2026-03-24T15:43:00Z
Lists: pgsql-hackers
Attachments
- v2-0001-Add-DDL-option-parsing-infrastructure-for-pg_get_.patch (text/x-patch) patch v2-0001
- v2-0002-Add-pg_get_role_ddl-function.patch (text/x-patch) patch v2-0002
- v2-0003-Add-pg_get_tablespace_ddl-function.patch (text/x-patch) patch v2-0003
- v2-0004-Add-pg_get_database_ddl-function.patch (text/x-patch) patch v2-0004
On Fri, Mar 20, 2026, at 10:31 AM, Andrew Dunstan wrote: > > Oh, hmm, yes, I think we did. Will work on it. > Here is a new patchset (v2) including all suggested changes in this thread. It fixes: * DDLOptType: comma in the last element; * union for boolval, textval, intval; * va_list in a restricted scope; * foreach_ptr + boolean in patches 0002 and 0004; * list_nth instead of list_nth_cell in patches 0002 and 0004; * OWNER = role typo. Add test; * use pstrdup for dbname; * output only database-specific GUCs; * add ACL_CONNECT check as the original patch. I removed the pg_read_all_stats case because it doesn't match the role description; However, I didn't include the suggestion to explain that pg_get_role_ddl is dependent on the DateStyle. I think it fits better in the CREATE ROLE [1] that does not mention it in the VALID UNTIL clause. I'm not opposed to the idea of adding a sentence to the function description but my suggestion is that this new sentence points to CREATE ROLE page. [1] https://www.postgresql.org/docs/current/sql-createrole.html -- Euler Taveira EDB https://www.enterprisedb.com/
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Use named boolean parameters for pg_get_*_ddl option arguments
- d6ed87d19890 19 (unreleased) landed
-
Convert ddlutils regression tests to TAP tests.
- c529ee38b9eb 19 (unreleased) landed
-
Fix pfree crash in pg_get_role_ddl() and pg_get_database_ddl().
- 1f108fc02ece 19 (unreleased) landed
-
Fixups for a4f774cf1c7
- 6c7bce28c83f 19 (unreleased) landed
-
Add infrastructure for pg_get_*_ddl functions
- 4881981f9202 19 (unreleased) landed
-
Add pg_get_database_ddl() function
- a4f774cf1c7e 19 (unreleased) landed
-
Add pg_get_role_ddl() function
- 76e514ebb4b5 19 (unreleased) landed
-
Add pg_get_tablespace_ddl() function
- b99fd9fd7f36 19 (unreleased) landed