Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pxZVf-0000Od-Q1 for pgsql-general@arkaria.postgresql.org; Fri, 12 May 2023 20:37:03 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pxZVe-0006V4-K1 for pgsql-general@arkaria.postgresql.org; Fri, 12 May 2023 20:37:02 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pxZVe-0006Uv-9F for pgsql-general@lists.postgresql.org; Fri, 12 May 2023 20:37:02 +0000 Received: from tamriel.snowman.net ([2001:470:e38f::11]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1pxZVY-001zRE-Ou for pgsql-general@lists.postgresql.org; Fri, 12 May 2023 20:37:00 +0000 Received: by tamriel.snowman.net (Postfix, from userid 1000) id F277E5F7B7; Fri, 12 May 2023 16:36:51 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=snowman.net; s=dkim; t=1683923811; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=kUfnJnrE2bX5PGAzvaYU+xSdYC1GJbwLXCND8zmZAQE=; b=xlkjYye1UUqwn/R9oTMlKWb62g91ik1CEhJuCBaUpjCV2pARzoLeRK29bxARvRm897K0u/ QPifkxGkp43Z8w3mFSnnFzDaX1okEuAuNJgwiJgcD8mqWLZhQxIN4/DkGSSshQmR6WK3iO RJQULCimVixFJ3B0b7QOv/5pHbHMBAo= Date: Fri, 12 May 2023 16:36:51 -0400 From: Stephen Frost To: Tom Lane Cc: Nathaniel Sabanski , pgsql-general@lists.postgresql.org Subject: Re: Adding SHOW CREATE TABLE Message-ID: References: <7a5d6750-84fa-59b0-33c1-7a5d26b9bc74@evolvis.org> <1565715.1683923271@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="pleNqkeJMZ0ms+Uk" Content-Disposition: inline In-Reply-To: <1565715.1683923271@sss.pgh.pa.us> User-Agent: Mutt/2.1.4 (2021-12-11) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --pleNqkeJMZ0ms+Uk Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Greetings, * Tom Lane (tgl@sss.pgh.pa.us) wrote: > Stephen Frost writes: > > Again, would be great to see someone actually work on this. There's > > already a good chunk of code in core in pg_dump and in the postgres_fdw > > for doing exactly this and it'd be great to consolidate that and at the > > same time expose it via SQL. >=20 > Note that this is hardly new ground: we've heard more-or-less the same > proposal many times before. I think the reason it's gone nowhere is > that most of the existing infrastructure is either in pg_dump or designed > to support pg_dump, and pg_dump is *extremely* opinionated about what > it wants and how it wants the data sliced up, for very good reasons. > Reconciling those requirements with a typical user's "just give me a > reconstructed CREATE TABLE command" request seems fairly difficult. Yet we're already duplicating much of this in postgres_fdw. If we don't want to get involved in pg_dump's feelings on the subject, we could look to postgres_fdw's independent implementation which might be more in-line with what users are expecting. Having two separate copies of code that does this and continuing to refuse to give users a way to ask for it themselves seems at the least like an odd choice. > Also, since pg_dump will still need to support old servers, it's hard > to believe we'd accept any proposal to move that functionality into > the server side, which in turn means that it's not going to be an easy > SQL command. No, it won't make sense to have yet another copy that's for the currently-running-server-only, which is why I suggested it go into either a common library or maybe into libpq. I don't feel it would be bad for the common code to have the multi-version understanding even if the currently running backend will only ever have the option to ask for the code path that matches its version. > These issues probably could be surmounted with enough hard work, but > please understand that just coming along with a request is not going > to cause it to happen. People have already done that. (Searching > the mailing list archives might be edifying.) Agreed- someone needs to have a fair bit of time and willingness to push on this to make it happen. Thanks, Stephen --pleNqkeJMZ0ms+Uk Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEwf6gbxKhD863zrx/7WyKOINHZFUFAmReo2EACgkQ7WyKOINH ZFVNuA/6AnNXHpwY4YwH38eoP6L7WKeuqjGtsSpkG88KaSxV8u8/ZNuB3/cQGmB0 2uKllnFxwxvRPjD9qCppyuQyaQ/D7D6HVATM5pLiIGLIotOGfOcmx4kXXUYeyE6k 2RlXZAGJ6qnoe6bnOMh/N/Kt63xXSBW40FjjhefTfaCmalaH2FRnWyHYWQSJmbDi +N+PPkZ1khUmMvjbsiY3pS7dqFRk0BDy0Ne2+vvc4yHHShNFH4DcQI49ykhsq28M 8caMUGyE6e5/2SRh3JaQxyiQgWTp8mhcSf/tB6EhY2mkGYjrLSYiJI1pMFrVKiRh wXOmOyFnru9CLswPnJmSpZusple11c46iLp4c+o+fUtuU13oXZVwoL5MdKm57CCI Nc8E3DIb4qyFy17WvoLBeCZdcnl/n19W6yKAUg19r31xQhJPpDMtONOjQgqbWHjD dtfa+bOynqiSagH3RlMKcH0e4t2IYhiqqnU7sYvbsg8rQ5vcZmuvwaRbBvl4hG8h FFmqnNUOCzj5SwZBQmK3KLap8ur1cRrHukLGa+0QxTguXsHxWOFoCzI6247LMQyU ArTgUi9bnraxU6h0xD59Q/105quGCr95r/z0SohRsWACpDruQqK1SDFGy4DHRQM/ PUibRqKSWOZI86/35Pr8puUl6ubLhXeroZqHYvuz1Zqn3a27UUc= =q/CL -----END PGP SIGNATURE----- --pleNqkeJMZ0ms+Uk--