Re: [PATCH] Add pg_get_table_ddl() to reconstruct CREATE TABLE statements

Akshay Joshi <akshay.joshi@enterprisedb.com>

From: Akshay Joshi <akshay.joshi@enterprisedb.com>
To: Zsolt Parragi <zsolt.parragi@percona.com>
Cc: pgsql-hackers@lists.postgresql.org
Date: 2026-06-11T07:48:07Z
Lists: pgsql-hackers

Attachments

On Thu, Jun 11, 2026 at 2:13 AM Zsolt Parragi <zsolt.parragi@percona.com>
wrote:

> Thanks for the update! The new version looks mostly good, I only found
> one corner case that doesn't work, double quoted literals can still
> get over-stripped:
>
> CREATE SCHEMA s;
> CREATE TABLE s.p (id int, "s.weird" int) PARTITION BY RANGE (id);
> CREATE TABLE s.pc PARTITION OF s.p
>     (CONSTRAINT chk CHECK ("s.weird" > 0)) FOR VALUES FROM (0) TO (100);
> SELECT * FROM pg_get_table_ddl('s.pc', 'owner', 'false',
>                                'schema_qualified', 'false');
>

  Fixed the issue above. The v5 patch is ready for review/testing.