Re: [PATCH] Add pg_get_database_ddl() function to reconstruct CREATE DATABASE statement

Chao Li <li.evan.chao@gmail.com>

From: Chao Li <li.evan.chao@gmail.com>
To: Akshay Joshi <akshay.joshi@enterprisedb.com>
Cc: Quan Zongliang <quanzongliang@yeah.net>, pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2025-11-14T07:03:15Z
Lists: pgsql-hackers

Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. Add infrastructure for pg_get_*_ddl functions

  2. Add pg_get_database_ddl() function

  3. Add new OID alias type regdatabase.

Hi Akshay,

I quick went through the patch, I do see some problems, but I need some time to wrap up, so I will do a deep review next week. In the meantime, I want to first ask that why there is no privilege check? I think that’s a serious issue.

> On Nov 13, 2025, at 16:32, Akshay Joshi <akshay.joshi@enterprisedb.com> wrote:
> 
> 
> <v2-0001-Add-pg_get_database_ddl-function-to-reconstruct-CREATE.patch>

Best regards,
--
Chao Li (Evan)
HighGo Software Co., Ltd.
https://www.highgo.com/