From db169985c10f02fa6d97920b0fafdde0ade3fde8 Mon Sep 17 00:00:00 2001 From: Andrew Dunstan Date: Sat, 12 Sep 2026 11:54:41 -0400 Subject: [PATCH] Revert pg_get_role_ddl(), pg_get_tablespace_ddl(), and pg_get_database_ddl(). List of commits reverted: 4881981f920 Add infrastructure for pg_get_*_ddl functions 76e514ebb4b Add pg_get_role_ddl() function b99fd9fd7f3 Add pg_get_tablespace_ddl() function a4f774cf1c7 Add pg_get_database_ddl() function 6c7bce28c83 Fixups for a4f774cf1c7 1f108fc02ec Fix pfree crash in pg_get_role_ddl() and pg_get_database_ddl(). cda0c4c5d6f Reject invalid databases in pg_get_database_ddl() 79fba6ebaba doc: Fix missing role attribute in pg_get_tablespace_ddl() description. c529ee38b9e Convert ddlutils regression tests to TAP tests. df1bac400fb Fix timezone dependence in test_misc/012_ddlutils.pl 5642a0367c2 Avoid SIGSEGV in pg_get_database_ddl() on NULL tablespace 2af70e93747 Fix incorrect declarations of variadic pg_get_*_ddl() functions. d6ed87d1989 Use named boolean parameters for pg_get_*_ddl option arguments plus the corresponding release notes entries. Discussion: https://postgr.es/m/20260827015242.54.noahmisch@microsoft.com --- doc/src/sgml/func/func-info.sgml | 118 --- doc/src/sgml/release-19.sgml | 36 - src/backend/utils/adt/ddlutils.c | 977 ------------------- src/backend/utils/adt/meson.build | 1 - src/backend/utils/adt/ruleutils.c | 4 +- src/include/catalog/catversion.h | 2 +- src/include/catalog/pg_proc.dat | 22 - src/include/utils/ruleutils.h | 1 - src/test/modules/test_misc/meson.build | 1 - src/test/modules/test_misc/t/012_ddlutils.pl | 341 ------- 10 files changed, 3 insertions(+), 1500 deletions(-) delete mode 100644 src/backend/utils/adt/ddlutils.c delete mode 100644 src/test/modules/test_misc/t/012_ddlutils.pl diff --git a/doc/src/sgml/func/func-info.sgml b/doc/src/sgml/func/func-info.sgml index 1ff023b741c..fc8d38872cd 100644 --- a/doc/src/sgml/func/func-info.sgml +++ b/doc/src/sgml/func/func-info.sgml @@ -3843,122 +3843,4 @@ acl | {postgres=arwdDxtm/postgres,foo=r/postgres} - - Get Object DDL Functions - - - The functions shown in - reconstruct DDL statements for various global database objects. - Each function returns a set of text rows, one SQL statement per row. - (This is a decompiled reconstruction, not the original text of the - command.) - - - - Get Object DDL Functions - - - - - Function - - - Description - - - - - - - - - pg_get_database_ddl - - pg_get_database_ddl - ( database regdatabase - , pretty boolean - DEFAULT false - , owner boolean - DEFAULT true - , tablespace boolean - DEFAULT true ) - setof text - - - Reconstructs the CREATE - DATABASE statement for the specified database, - followed by ALTER DATABASE - statements for connection limit, template status, - and configuration settings. Each statement is returned as a separate - row. When pretty is true, the output is - pretty-printed. When owner is false, the - OWNER clause is omitted. When - tablespace is false, the - TABLESPACE clause is omitted. - - - - - - pg_get_role_ddl - - pg_get_role_ddl - ( role regrole - , pretty boolean - DEFAULT false - , memberships boolean - DEFAULT true ) - setof text - - - Reconstructs the CREATE ROLE - statement and any - ALTER ROLE ... SET statements for the given - role. Each statement is returned as a separate row. - Password information is never included in the output. - When pretty is true, the output is - pretty-printed. When memberships is false, - GRANT statements - for role memberships are omitted. - - - - - - pg_get_tablespace_ddl - - pg_get_tablespace_ddl - ( tablespace oid - , pretty boolean - DEFAULT false - , owner boolean - DEFAULT true ) - setof text - - - pg_get_tablespace_ddl - ( tablespace name - , pretty boolean - DEFAULT false - , owner boolean - DEFAULT true ) - setof text - - - Reconstructs the CREATE - TABLESPACE statement for the specified tablespace (by - OID or name). If the tablespace has options set, an - ALTER TABLESPACE ... SET - statement is also returned. Each statement is - returned as a separate row. When pretty is - true, the output is pretty-printed. When owner - is false, the OWNER clause is omitted. - - - - -
- -
- diff --git a/doc/src/sgml/release-19.sgml b/doc/src/sgml/release-19.sgml index 0629eec6db0..a1c86100ed1 100644 --- a/doc/src/sgml/release-19.sgml +++ b/doc/src/sgml/release-19.sgml @@ -2278,42 +2278,6 @@ The Dutch stemmer has also been updated. The old Dutch stemmer is available via - - - - -Add function pg_get_role_ddl() to output role creation commands (Mario Gonzalez, Bryan Green, Andrew Dunstan, Euler Taveira) -§ - - - - - - - -Add function pg_get_tablespace_ddl() to output tablespace creation commands (Nishant Sharma, Manni Wood, Andrew Dunstan, Euler Taveira) -§ - - - - - - - -Add function pg_get_database_ddl() to output database creation commands (Akshay Joshi, Andrew Dunstan, Euler Taveira) -§ - - -