Re: Adding SHOW CREATE TABLE

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Stephen Frost <sfrost(at)snowman(dot)net>
Cc: Nathaniel Sabanski <sabanski(dot)n(at)gmail(dot)com>, pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: Adding SHOW CREATE TABLE
Date: 2023-05-12 20:27:51
Message-ID: 1565715.1683923271@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

Stephen Frost <sfrost(at)snowman(dot)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.

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.

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.)

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Stephen Frost 2023-05-12 20:36:51 Re: Adding SHOW CREATE TABLE
Previous Message Stephen Frost 2023-05-12 20:14:27 Re: Adding SHOW CREATE TABLE

Browse pgsql-hackers by date

  From Date Subject
Next Message Stephen Frost 2023-05-12 20:36:51 Re: Adding SHOW CREATE TABLE
Previous Message Stephen Frost 2023-05-12 20:14:27 Re: Adding SHOW CREATE TABLE