From: Tom Lane <tgl@sss.pgh.pa.us>
To: Robert Haas <robertmhaas@gmail.com>
Cc: Andres Freund <andres@anarazel.de>
Cc: Noah Misch <noah@leadboat.com>
Cc: Andrew Dunstan <andrew@dunslane.net>
Cc: Melanie Plageman <melanieplageman@gmail.com>
Cc: gonzalemario@gmail.com
Cc: dbryan.green@gmail.com
Cc: euler@eulerto.com
Cc: pgsql-hackers@postgresql.org
Subject: Re: pg_get_*_ddl() needs a redesign
Date: Fri, 11 Sep 2026 11:58:31 -0400
Message-ID: <1242186.1789142311@sss.pgh.pa.us> (raw)
In-Reply-To: <CA+TgmoY3E5iAtV_=ihkRAgKL7Mrx0EETBYR3w9ukDg=5g7X=gQ@mail.gmail.com>
References: <20260827015242.54.noahmisch@microsoft.com>
<CAAKRu_a0KX2OONvtcEOwyOX0DzOC-B8sh-w8s5tNkKwczmVzeQ@mail.gmail.com>
<c75aa91a-7029-4c69-9f98-fe4d2f18bc11@dunslane.net>
<20260909172132.0a.noahmisch@microsoft.com>
<640139.1788975299@sss.pgh.pa.us>
<ccd76a86-51c0-4395-b6b2-2e7214c2fbf2@dunslane.net>
<20260910035953.59.noahmisch@microsoft.com>
<CA+Tgmoa2aBFUREeN1AWZ9O8h5WjTD0wdwAzDJj4c3j5aOP=eTA@mail.gmail.com>
<956966.1789102554@sss.pgh.pa.us>
<25geh4lsb4uwqurcvh4toqbeknjmo5arw5rdvubtghdxz2bdk3@fqenqkj464zj>
<994515.1789139681@sss.pgh.pa.us>
<CA+TgmoY3E5iAtV_=ihkRAgKL7Mrx0EETBYR3w9ukDg=5g7X=gQ@mail.gmail.com>
Robert Haas <robertmhaas@gmail.com> writes:
> On Fri, Sep 11, 2026 at 11:14 AM Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> Users
>> don't always have the luxury of being able to follow the advice to
>> "use the newest pg_dump to make your dump".
> I completely agree with this. But when they don't, things break pretty
> regularly. Just to take one example, adding a new parser keyword can
> require quoting to be added to older dumps, which obviously won't work
> if the list of identifiers needing quoting is taken from the target
> system's tables rather than pg_dump's own knowledge.
Maybe --quote-all-identifiers should be the default? I don't think
that we break old syntax "pretty regularly" in any other way.
But that's a side point.
> That's one of many reasons why I do not think this feature can share
> code with pg_dump in any meaningful way. We either decide that we're
> OK with having this feature for situations where people just want a
> quick SQL representation of an existing object without worrying about
> all the stuff pg_dump deals with, or we discard the feature. I don't
> think there's an intermediate world where this feature can serve the
> needs of pg_dump. I'd love to be wrong; if somebody has a great idea,
> cool. But I don't see it.
I'm not quite convinced. But if that's really the case, I'm voting
for "discard the feature". It's not useful enough to justify doubling
the maintenance load associated with DDL reconstruction.
regards, tom lane
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-hackers@postgresql.org
Cc: tgl@sss.pgh.pa.us, robertmhaas@gmail.com, andres@anarazel.de, noah@leadboat.com, andrew@dunslane.net, melanieplageman@gmail.com, gonzalemario@gmail.com, dbryan.green@gmail.com, euler@eulerto.com
Subject: Re: pg_get_*_ddl() needs a redesign
In-Reply-To: <1242186.1789142311@sss.pgh.pa.us>
References: <20260827015242.54.noahmisch@microsoft.com> <CAAKRu_a0KX2OONvtcEOwyOX0DzOC-B8sh-w8s5tNkKwczmVzeQ@mail.gmail.com> <c75aa91a-7029-4c69-9f98-fe4d2f18bc11@dunslane.net> <20260909172132.0a.noahmisch@microsoft.com> <640139.1788975299@sss.pgh.pa.us> <ccd76a86-51c0-4395-b6b2-2e7214c2fbf2@dunslane.net> <20260910035953.59.noahmisch@microsoft.com> <CA+Tgmoa2aBFUREeN1AWZ9O8h5WjTD0wdwAzDJj4c3j5aOP=eTA@mail.gmail.com> <956966.1789102554@sss.pgh.pa.us> <25geh4lsb4uwqurcvh4toqbeknjmo5arw5rdvubtghdxz2bdk3@fqenqkj464zj> <994515.1789139681@sss.pgh.pa.us> <CA+TgmoY3E5iAtV_=ihkRAgKL7Mrx0EETBYR3w9ukDg=5g7X=gQ@mail.gmail.com> <1242186.1789142311@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox