Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1x53eD-007aq0-0o for pgsql-hackers@arkaria.postgresql.org; Fri, 11 Sep 2026 15:58:41 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1x53eC-00Fuqv-0D for pgsql-hackers@arkaria.postgresql.org; Fri, 11 Sep 2026 15:58:40 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1x53eB-00FuqY-2T for pgsql-hackers@lists.postgresql.org; Fri, 11 Sep 2026 15:58:39 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1x53e9-000000059xj-3VrL for pgsql-hackers@postgresql.org; Fri, 11 Sep 2026 15:58:38 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.18.1/8.18.1) with ESMTP id 68BFwVG11242187; Fri, 11 Sep 2026 11:58:31 -0400 From: Tom Lane To: Robert Haas cc: Andres Freund , Noah Misch , Andrew Dunstan , Melanie Plageman , gonzalemario@gmail.com, dbryan.green@gmail.com, euler@eulerto.com, pgsql-hackers@postgresql.org Subject: Re: pg_get_*_ddl() needs a redesign In-reply-to: References: <20260827015242.54.noahmisch@microsoft.com> <20260909172132.0a.noahmisch@microsoft.com> <640139.1788975299@sss.pgh.pa.us> <20260910035953.59.noahmisch@microsoft.com> <956966.1789102554@sss.pgh.pa.us> <25geh4lsb4uwqurcvh4toqbeknjmo5arw5rdvubtghdxz2bdk3@fqenqkj464zj> <994515.1789139681@sss.pgh.pa.us> Comments: In-reply-to Robert Haas message dated "Fri, 11 Sep 2026 11:24:24 -0400" MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-ID: <1242185.1789142311.1@sss.pgh.pa.us> Content-Transfer-Encoding: 8bit Date: Fri, 11 Sep 2026 11:58:31 -0400 Message-ID: <1242186.1789142311@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Robert Haas writes: > On Fri, Sep 11, 2026 at 11:14 AM Tom Lane 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