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

From: Akshay Joshi <akshay(dot)joshi(at)enterprisedb(dot)com>
To: Zsolt Parragi <zsolt(dot)parragi(at)percona(dot)com>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: [PATCH] Add pg_get_table_ddl() to reconstruct CREATE TABLE statements
Date: 2026-06-11 07:48:07
Message-ID: CANxoLDco7z7Fj7_pj_3YQLvjq8ZH2Ai4c3GcOamed01fZhJ77Q@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Jun 11, 2026 at 2:13 AM Zsolt Parragi <zsolt(dot)parragi(at)percona(dot)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.

Attachment Content-Type Size
v5-0001-Add-pg_get_table_ddl-to-reconstruct-CREATE-TABLE.patch application/octet-stream 122.6 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message cca5507 2026-06-11 07:50:19 Re: [BUG] Take a long time to reach consistent after pg_rewind
Previous Message Peter Smith 2026-06-11 07:37:52 Re: Add pg_get_publication_ddl function