Re: Adding SHOW CREATE TABLE - Mailing list pgsql-general

From Kirk Wolak
Subject Re: Adding SHOW CREATE TABLE
Date
Msg-id CACLU5mQw3wQp+ySHFGy90SqWPqCBw0DjdNQ_QDaQAvFG=OM3CA@mail.gmail.com
Whole thread Raw
In response to Re: Adding SHOW CREATE TABLE  (Stephen Frost <sfrost@snowman.net>)
List pgsql-general
On Fri, May 12, 2023 at 8:37 PM Stephen Frost <sfrost@snowman.net> wrote:
Greetings,
...
Yes, it's a large effort, no doubt.


Stephen, I started looking at the code.
And I have the queries from \set SHOW_HIDDEN
that psql uses.  And also the pg_dump output.

 My first table was an ID bigint NOT NULL PRIMARY KEY GENERATED ALWAYS AS IDENTITY

pg_dump puts the decorations on the SEQUENCE
\dt puts that text as the "Default" value

But the STRANGE part for me is the query I Assembled from the FDW returns nothing for extra attributes.
And only seems to care about the "GENERATED AS (%s) STORED" syntax.

For me, generating the INLINE syntax will produce the SEQUENCE automatically, so this is my preference.
Let me know if I am missing anything... Please.

Finally, I cannot GRASP this additional syntax:
appendStringInfo(&buf, "\n) SERVER %s\nOPTIONS (",

This is at the end of the create table syntax:
CREATE TABLE %s ( ...  ) SERVER %s\n OPTIONS ("  ...");

Is this special "FDW" Decorations because I don't see those on the create table documentation?
It's easy enough to ignore, but I don't want to miss something.

Kirk...

pgsql-general by date:

Previous
From: Christophe Pettus
Date:
Subject: xid type? (was :)
Next
From: jian he
Date:
Subject: Re: function signature allow "default" keyword