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

From: Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>
To: akshay(dot)joshi(at)enterprisedb(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-07-02 02:17:15
Message-ID: 20260702.111715.277646207293239004.horikyota.ntt@gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hello,

Looking at this, one thing that concerns me is the large amount of
overlap with dumpTableSchema() in pg_dump.

I wonder if it would make sense to separate the SQL generation logic
into frontend/backend-shared code so that it could also be used by
pg_dump. The catalog lookup would naturally remain separate, but
sharing the DDL generation itself would significantly reduce the
duplication.

By the way, a couple of comments use a Unicode RIGHTWARDS ARROW
(U+2192). Please use an ASCII equivalent instead.

Regards,

--
Kyotaro Horiguchi
NTT Open Source Software Center

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Thom Brown 2026-07-02 02:46:14 Re: Per-thread leak in ECPG's memory.c
Previous Message Ewan Young 2026-07-02 02:08:33 Re: satisfies_hash_partition crash