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

From: Akshay Joshi <akshay(dot)joshi(at)enterprisedb(dot)com>
To: Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>
Cc: zsolt(dot)parragi(at)percona(dot)com, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: [PATCH] Add pg_get_table_ddl() to reconstruct CREATE TABLE statements
Date: 2026-06-15 08:55:06
Message-ID: CANxoLDcb3AavOjvikn+2fmSX18fStQOpHFq+b7byf6LFUDx0yw@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi Kyotaro and Zsolt,

I have incorporated the feedback provided by both of you.
The v6 patch is updated and ready for your review.

On Fri, Jun 12, 2026 at 6:40 AM Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>
wrote:

> Hello.
>
> At Thu, 11 Jun 2026 13:18:07 +0530, Akshay Joshi <
> akshay(dot)joshi(at)enterprisedb(dot)com> wrote in
> > Fixed the issue above. The v5 patch is ready for review/testing.
>
> I have not looked at the patch in detail, but I noticed that some
> comments in the patch seem to contain non-ASCII characters.
>
> > * * re-emitting it as ALTER TABLE … ADD CONSTRAINT ― the column-emit
>
> I don't think that is recommended in PostgreSQL source comments, so
> these should probably be replaced with plain ASCII equivalents.
>
>
> https://www.postgresql.org/message-id/E1pnhhu-003D6z-Ki%40gemulon.postgresql.org
>
> For reference, I have attached the result of a quick search below.
>
> Regards,
>
> --
> Kyotaro Horiguchi
> NTT Open Source Software Center
>
>
> Quick search result:
>
> =========
> 20 matches in 18 lines for "[^[:ascii:]]" in buffer:
> v5-0001-Add-pg_get_table_ddl-to-reconstruct-CREATE-TABLE.patch
> 565:+ * re-emitting it as ALTER TABLE … ADD CONSTRAINT ― the
> column-emit
> 877:+ * defaults ― mirroring
> pg_get_database_ddl's pattern of
> 934:+ * SEQUENCE NAME ―
> omit when it matches the implicit
> 1042:+ * Table-level CHECK constraints ― emitted inline in the
> CREATE TABLE
> 1055:+ * applied per-column overrides ― DEFAULT, NOT NULL,
> and any locally
> 1155:+ * pg_get_ruledef, pg_get_statisticsobjdef_string) ― when
> 1383:+ * ALTER TABLE qualname ALTER COLUMN col SET DEFAULT
> expr ― one per
> 1422:+ * ALTER TABLE qualname ALTER COLUMN col SET (...) ―
> one per column
> 1468:+ * out-of-line by emit_local_constraints (the ALTER
> TABLE … ADD
> 1500:+ * ALTER TABLE … ADD CONSTRAINT for each
> locally-defined constraint
> 1617:+ * ALTER TABLE qualname REPLICA IDENTITY … ― emitted
> only when the
> 1749:+ * (#if 0) ― they will become a single helper call once the
> standalone
> 1830:+ * Pre-compute "<schema>." too ― the always-qualified
> helpers
> 1884:+ * Triggers and row-level security policies ― disabled
> until the
> 2680:+-- quoting (its prefix starts with "). Both forms of the prefix ―
> 2681:+-- bare-lowercase and quoted ― must be stripped from outer
> 3197:+-- quoting (its prefix starts with "). Both forms of the prefix ―
> 3198:+-- bare-lowercase and quoted ― must be stripped from outer
> =========
>

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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Smith 2026-06-15 08:58:50 Re: Proposal: Conflict log history table for Logical Replication
Previous Message Renaud Métrich 2026-06-15 08:53:29 Re: [PATCH v2] Add ssl_alt_cert_file/ssl_alt_key_file for dual RSA+ECDSA certificate support