pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Stephen Frost <sfrost@snowman.net>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Nathaniel Sabanski <sabanski.n@gmail.com>
Cc: pgsql-general@lists.postgresql.org
Subject: Re: Adding SHOW CREATE TABLE
Date: Fri, 12 May 2023 16:36:51 -0400
Message-ID: <ZF6jY1vqhxfGME+b@tamriel.snowman.net> (raw)
In-Reply-To: <1565715.1683923271@sss.pgh.pa.us>
References: <CAFEN2wxsDSSuOvrU03CE33ZphVLqtyh9viPp6huODCDx2UQkYA@mail.gmail.com>
	<ZF5Da5Ge1+RpiviX@tamriel.snowman.net>
	<CAFEN2wzmO-VqOjOU3EyWzBCckDY3-_nv5sXQJPunteNHq9r11A@mail.gmail.com>
	<7a5d6750-84fa-59b0-33c1-7a5d26b9bc74@evolvis.org>
	<CAKFQuwa2cYznMsZRdfDXqDD0T5F+cRruZxfu_W9BtDh+A5RYHg@mail.gmail.com>
	<CAFEN2wwzcNot7OuV-4CLo5qf8UNZyc7pkEitJiYrj6VRTL4vmQ@mail.gmail.com>
	<CAFEN2wxg0Vtj1gvk6Ms0L2CAutbycyxHZPiZSpW7eLsBc6VGnA@mail.gmail.com>
	<ZF6eIysBeQrXpz7r@tamriel.snowman.net>
	<1565715.1683923271@sss.pgh.pa.us>

Greetings,

* Tom Lane (tgl@sss.pgh.pa.us) wrote:
> Stephen Frost <sfrost@snowman.net> 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.
> 
> 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

Attachments:

  signature.asc (application/pgp-signature, 832B) download

view thread (46+ messages)  latest in thread

Message-ID: <ZF6jY1vqhxfGME+b@tamriel.snowman.net>
Permalink:  ../ZF6jY1vqhxfGME+b@tamriel.snowman.net/
Also on:    postgresql.org/message-id/ZF6jY1vqhxfGME+b@tamriel.snowman.net

 · 

reply

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-general@postgresql.org
  Cc: sfrost@snowman.net, tgl@sss.pgh.pa.us, sabanski.n@gmail.com
  Subject: Re: Adding SHOW CREATE TABLE
  In-Reply-To: <ZF6jY1vqhxfGME+b@tamriel.snowman.net>
  References: <CAFEN2wxsDSSuOvrU03CE33ZphVLqtyh9viPp6huODCDx2UQkYA@mail.gmail.com> <ZF5Da5Ge1+RpiviX@tamriel.snowman.net> <CAFEN2wzmO-VqOjOU3EyWzBCckDY3-_nv5sXQJPunteNHq9r11A@mail.gmail.com> <7a5d6750-84fa-59b0-33c1-7a5d26b9bc74@evolvis.org> <CAKFQuwa2cYznMsZRdfDXqDD0T5F+cRruZxfu_W9BtDh+A5RYHg@mail.gmail.com> <CAFEN2wwzcNot7OuV-4CLo5qf8UNZyc7pkEitJiYrj6VRTL4vmQ@mail.gmail.com> <CAFEN2wxg0Vtj1gvk6Ms0L2CAutbycyxHZPiZSpW7eLsBc6VGnA@mail.gmail.com> <ZF6eIysBeQrXpz7r@tamriel.snowman.net> <1565715.1683923271@sss.pgh.pa.us> <ZF6jY1vqhxfGME+b@tamriel.snowman.net>

* 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