Waiting for PostgreSQL 19 – new pg_get_*_ddl() functions
On 5th of April 2026, Andrew Dunstan committed patch: Add pg_get_database_ddl() function Add a new SQL-callable function that returns the DDL statements needed to recreate a database. It takes a regda