pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Ron <ronljohnsonjr@gmail.com>
To: pgsql-general@lists.postgresql.org
Subject: Re: Adding SHOW CREATE TABLE
Date: Sat, 13 May 2023 13:28:11 -0500
Message-ID: <fac9def3-57f6-980a-48c3-2d57b0890ede@gmail.com> (raw)
In-Reply-To: <CACLU5mQDDhdwu4Z8aRqNrc+UDLTE+GmfZPbxn39dha5m_EUEfQ@mail.gmail.com>
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>
	<CACLU5mROQewFBFXG=C6DMvEtDgGZoF9k=m_bkTJYFgSNZptUkg@mail.gmail.com>
	<1aac01a1-d9db-8048-9bfa-1e4f9bb69a03@gmail.com>
	<CACLU5mQDDhdwu4Z8aRqNrc+UDLTE+GmfZPbxn39dha5m_EUEfQ@mail.gmail.com>

On 5/13/23 02:25, Kirk Wolak wrote:
> On Sat, May 13, 2023 at 1:03 AM Ron <ronljohnsonjr@gmail.com> wrote:
>
>     On 5/12/23 18:00, Kirk Wolak wrote:
>     [snip]
>>     Where do we draw the lines?
>
>     At other tables.
>
>>     Does Table DDL include all indexes?
>
>     Absolutely!
>
>>     It should include constraints, clearly.  I would not think it should
>>     have triggers.
>
>     Definitely triggers.  And foreign keys.
>
>>     Literally everything within the <<CREATE TABLE X(...);>>.  (ie, no
>>     ALTER .. OWNER TO...)
>>
>
>     ALTER statements, too.  If CREATE TABLE ... LIKE ... { INCLUDING |
>     EXCLUDING } { COMMENTS | COMPRESSION | CONSTRAINTS | DEFAULTS |
>     GENERATED | IDENTITY | INDEXES | STATISTICS | STORAGE | ALL } can do
>     it, then so should SHOW CREATE TABLE.
>
>     -- 
>     Born in Arizona, moved to Babylonia.
>
>
> I can see the ALTER statements now.  Which is why I asked.
> I don't like the idea of including the trigger DDL, because that would 
> never execute in a clean environment.

I would not be grumpy if trigger statements weren't included.

> (I've never used a tool that tried to do that when I've wanted the DDL)
> I can go either way on index creation.
>
> Does this imply SQL SYNTAX like:
>
> SHOW CREATE TABLE <table_name>
>   [ INCLUDING { ALL | INDEXES |  SEQUENCES | ??? }]
>   [EXCLUDING { PK | FK | COMMENTS | STORAGE | } ]
>   [FOR {V11 | V12 | V13 | V14 | V15 }] ??
> ?

"FOR {V...}" is a complication too far, IMO.  No one expects "pg_dump 
--schema-only" to have a --version= option, so one should not expect SHOW 
CREATE TABLE to have a "FOR {V...}" clause.

> The goal for me  is to open the discussion, and then CONSTRAIN the focus.
>
> Personally, the simple syntax:
> SHOW CREATE TABLE table1;
>
> Should give me a create table command with the table attributes and the 
> column attributes, FKs, PKs, Defaults. Etc.
> But I would not expect it to generate index commands, etc.

-- 
Born in Arizona, moved to Babylonia.

view thread (46+ messages)  latest in thread

Message-ID: <fac9def3-57f6-980a-48c3-2d57b0890ede@gmail.com>
Permalink:  ../fac9def3-57f6-980a-48c3-2d57b0890ede@gmail.com/
Also on:    postgresql.org/message-id/fac9def3-57f6-980a-48c3-2d57b0890ede@gmail.com

 · 

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: ronljohnsonjr@gmail.com
  Subject: Re: Adding SHOW CREATE TABLE
  In-Reply-To: <fac9def3-57f6-980a-48c3-2d57b0890ede@gmail.com>
  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> <CACLU5mROQewFBFXG=C6DMvEtDgGZoF9k=m_bkTJYFgSNZptUkg@mail.gmail.com> <1aac01a1-d9db-8048-9bfa-1e4f9bb69a03@gmail.com> <CACLU5mQDDhdwu4Z8aRqNrc+UDLTE+GmfZPbxn39dha5m_EUEfQ@mail.gmail.com> <fac9def3-57f6-980a-48c3-2d57b0890ede@gmail.com>

* 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