Re: Adding SHOW CREATE TABLE

From: Kirk Wolak <wolakk(at)gmail(dot)com>
To: Jelte Fennema <postgres(at)jeltef(dot)nl>
Cc: Andrew Dunstan <andrew(at)dunslane(dot)net>, Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Adding SHOW CREATE TABLE
Date: 2023-06-22 00:52:32
Message-ID: CACLU5mSc3nKOS+XE2KZ_gk7Ccch+rzg9-V4XXLUsyjgvwD9pSA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

On Mon, Jun 5, 2023 at 7:43 AM Jelte Fennema <postgres(at)jeltef(dot)nl> wrote:

> On Thu, 1 Jun 2023 at 18:57, Kirk Wolak <wolakk(at)gmail(dot)com> wrote:
> > Can this get turned into a Patch? Were you offering this code up for
> others (me?) to pull, and work into a patch?
> > [If I do the patch, I am not sure it gives you the value of reducing
> what CITUS has to maintain. But it dawns on
> > me that you might be pushing a much bigger patch... But I would take
> that, as I think there is other value in there]
>
> Attached is a patch which adds the relevant functions from Citus to
> Postgres (it compiles without warnings on my machine). I checked with
> a few others on the Citus team at Microsoft and everyone thought that
> upstreaming this was a good idea, because it's quite a bit of work to
> update with every postgres release.
>
> To set expectations though, I don't really have time to work on this
> patch. So if you can take it over from here that would be great.
>
> The patch only contains the C functions which generate SQL based on
> some oids. The wrappers such as the master_get_table_ddl_events
> function were too hard for me to pull out of Citus code, because they
> integrated a lot with other pieces. But the bulk of the logic is in
> the functions in this patch. Essentially all that
> master_get_table_ddl_events does is call the functions in this patch
> in the right order.
>
> > The ONLY thing I did not see was "CREATE TEMPORARY " syntax? If you did
> this on a TEMP table,
> > does it generate normal table syntax or TEMPORARY TABLE syntax???
>
> Yeah, the Citus code only handles things that Citus supports in
> distributed tables. Which is quite a lot, but indeed not everything
> yet. Temporary and inherited tables are not supported in this code
> afaik. Possibly more. See the commented out
> EnsureRelationKindSupported for what should be supported (normal
> tables and partitioned tables afaik).
>

Jelte,
Thank you for this.
Let me see what I can do with this, it seems like a solid starting point.
At this point, based on previous feedback, finding a way to make
get_tabledef() etc. to work as functions is my goal.
I will see how inherited tables and temporary tables will be dealt with.

Hopefully, this transfer works to please anyone concerned with
integrating this code into our project from the Citus code.

Kirk...

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message shveta malik 2023-06-22 04:09:30 Re: Support logical replication of DDLs
Previous Message Marc Millas 2023-06-21 16:10:13 Re: pb with join plan

Browse pgsql-hackers by date

  From Date Subject
Next Message David Rowley 2023-06-22 00:53:10 Re: extended statistics n-distinct on multiple columns not used when join two tables
Previous Message Michael Paquier 2023-06-22 00:50:54 Re: allow granting CLUSTER, REFRESH MATERIALIZED VIEW, and REINDEX