Re: Adding SHOW CREATE TABLE

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Adding SHOW CREATE TABLE
Date: 2023-05-19 17:08:21
Message-ID: 6afd776b-45cf-2675-0cfe-981f1c6ade1d@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers


On 2023-05-18 Th 19:53, Stephen Frost wrote:
> Greetings,
>
> * Kirk Wolak (wolakk(at)gmail(dot)com) wrote:
>> My approach for now is to develop this as the \st command.
>> After reviewing the code/output from the 3 sources (psql, fdw, and
>> pg_dump). This trivializes the approach,
>> and requires the smallest set of changes (psql is already close with
>> existing queries, etc).
>>
>> And frankly, I would rather have an \st feature that handles 99% of the use
>> cases then go 15yrs waiting for a perfect solution.
>> Once this works well for the group. Then, IMO, that would be the time to
>> discuss moving it.
> Having this only available via psql seems like the least desirable
> option as then it wouldn't be available to any other callers..
>
> Having it in libpq, on the other hand, would make it available to psql
> as well as any other utility, library, or language / driver which uses
> libpq, including pg_dump..
>
> Using libpq would also make sense from the perspective that libpq can be
> used to connect to a number of different major versions of PG and this
> could work work for them all in much the way that pg_dump does.
>
> The downside with this apporach is that drivers which don't use libpq
> (eg: JDBC) would have to re-implement this if they wanted to keep
> feature parity with libpq..

I think the ONLY place we should have this is in server side functions.
More than ten years ago I did some work in this area (see below), but
it's one of those things that have been on my ever growing personal TODO
list

See <https://bitbucket.org/adunstan/retailddl/src/master/> and
<https://www.youtube.com/watch?v=fBarFKOL3SI>

cheers

andrew

--
Andrew Dunstan
EDB:https://www.enterprisedb.com

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Peter J. Holzer 2023-05-19 19:52:04 Re: Is there a good way to handle sum types (or tagged unions) in PostgreSQL?
Previous Message Mike Lissner 2023-05-19 16:49:13 Re: Trying to understand a failed upgrade in AWS RDS

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2023-05-19 17:16:16 Re: psql: Could we get "-- " prefixing on the **** QUERY **** outputs? (ECHO_HIDDEN)
Previous Message Andrew Dunstan 2023-05-19 17:03:14 Re: New COPY options: DELIMITER NONE and QUOTE NONE