Re: Adding SHOW CREATE TABLE

2023-05-17 Thread Kirk Wolak
On Sun, May 14, 2023 at 2:20 AM Kirk Wolak wrote: > On Sat, May 13, 2023 at 3:34 PM Jeremy Smith > wrote: > >> >> >> On Sat, May 13, 2023, 3:25 AM Kirk Wolak wrote: >> >>> Does this imply SQL SYNTAX like: >>> >>> SHOW CREATE TABLE >>> [ INCLUDING { ALL | INDEXES | SEQUENCES | ??? }] >>>

Re: Adding SHOW CREATE TABLE

2023-05-15 Thread Kirk Wolak
On Fri, May 12, 2023 at 8:37 PM Stephen Frost 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

Re: Adding SHOW CREATE TABLE

2023-05-14 Thread Kirk Wolak
On Sat, May 13, 2023 at 3:34 PM Jeremy Smith wrote: > > > On Sat, May 13, 2023, 3:25 AM Kirk Wolak wrote: > >> Does this imply SQL SYNTAX like: >> >> SHOW CREATE TABLE >> [ INCLUDING { ALL | INDEXES | SEQUENCES | ??? }] >> [EXCLUDING { PK | FK | COMMENTS | STORAGE | } ] >> [FOR {V11 |

Re: Adding SHOW CREATE TABLE

2023-05-13 Thread Jeremy Smith
On Sat, May 13, 2023, 3:25 AM Kirk Wolak wrote: > Does this imply SQL SYNTAX like: > > SHOW CREATE TABLE > [ INCLUDING { ALL | INDEXES | SEQUENCES | ??? }] > [EXCLUDING { PK | FK | COMMENTS | STORAGE | } ] > [FOR {V11 | V12 | V13 | V14 | V15 }] ?? > ? > Personally, I would expect a

Re: Adding SHOW CREATE TABLE

2023-05-13 Thread Ron
On 5/13/23 02:25, Kirk Wolak wrote: On Sat, May 13, 2023 at 1:03 AM Ron 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

Re: Adding SHOW CREATE TABLE

2023-05-13 Thread Kirk Wolak
On Fri, May 12, 2023 at 8:37 PM Stephen Frost wrote: > Greetings, > .. > I mean ... it's already in postgres_fdw, just not in a way that can be > returned to the user. I don't think I'd want this functionality to > depend on postgres_fdw or generally on an extension though, it should > be part

Re: Adding SHOW CREATE TABLE

2023-05-13 Thread Kirk Wolak
On Sat, May 13, 2023 at 1:03 AM Ron 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. >

Re: Adding SHOW CREATE TABLE

2023-05-12 Thread Ron
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

Re: Adding SHOW CREATE TABLE

2023-05-12 Thread Stephen Frost
Greetings, * Kirk Wolak (wol...@gmail.com) wrote: > On Fri, May 12, 2023 at 4:37 PM Stephen Frost wrote: > > * Tom Lane (t...@sss.pgh.pa.us) wrote: > > > Stephen Frost writes: > > > > Again, would be great to see someone actually work on this. There's > > > > already a good chunk of code in

Re: Adding SHOW CREATE TABLE

2023-05-12 Thread Kirk Wolak
On Fri, May 12, 2023 at 4:37 PM Stephen Frost wrote: > Greetings, > > * Tom Lane (t...@sss.pgh.pa.us) wrote: > > Stephen Frost 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 > > >

Re: Adding SHOW CREATE TABLE

2023-05-12 Thread Stephen Frost
Greetings, * Tom Lane (t...@sss.pgh.pa.us) wrote: > Stephen Frost 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

Re: Adding SHOW CREATE TABLE

2023-05-12 Thread Tom Lane
Stephen Frost 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

Re: Adding SHOW CREATE TABLE

2023-05-12 Thread Stephen Frost
Greetings, * Nathaniel Sabanski (sabansk...@gmail.com) wrote: > > Perhaps a bit more discussion about what exactly the use-case is would > > be helpful- what would you use this feature for? > > App writers: To facilitate table creation and simplify schema verification, > without relying on a GUI

Re: Adding SHOW CREATE TABLE

2023-05-12 Thread Nathaniel Sabanski
> Perhaps a bit more discussion about what exactly the use-case is would > be helpful- what would you use this feature for? App writers: To facilitate table creation and simplify schema verification, without relying on a GUI tool or ORM (or system calls out to pg_dump). Tool writers: Would

Re: Adding SHOW CREATE TABLE

2023-05-12 Thread Nathaniel Sabanski
On Fri, 12 May 2023 at 09:12, David G. Johnston wrote: > > > On Fri, May 12, 2023, 08:35 Thorsten Glaser wrote: > >> On Fri, 12 May 2023, Nathaniel Sabanski wrote: >> >> >I believe most users would anticipate a CREATE TABLE statement that >> aligns >> >with the currently installed version- this

Re: Adding SHOW CREATE TABLE

2023-05-12 Thread David G. Johnston
On Fri, May 12, 2023, 08:35 Thorsten Glaser wrote: > On Fri, 12 May 2023, Nathaniel Sabanski wrote: > > >I believe most users would anticipate a CREATE TABLE statement that aligns > >with the currently installed version- this is the practical solution for > > The currently installed version of

Re: Adding SHOW CREATE TABLE

2023-05-12 Thread Thomas Kellerer
Nathaniel Sabanski schrieb am 12.05.2023 um 13:29: HN had a thread regarding the challenges faced by new users during the adoption of Postgres in 2023. One particular issue that garnered significant votes was the lack of a "SHOW CREATE TABLE" command, and seems like it would be an easy one to

Re: Adding SHOW CREATE TABLE

2023-05-12 Thread Thorsten Glaser
On Fri, 12 May 2023, Nathaniel Sabanski wrote: >I believe most users would anticipate a CREATE TABLE statement that aligns >with the currently installed version- this is the practical solution for The currently installed version of what, the server or the client? bye, //mirabilos -- 15:41⎜

Re: Adding SHOW CREATE TABLE

2023-05-12 Thread Stephen Frost
Greetings, Please don't top-post on these lists. * Nathaniel Sabanski (sabansk...@gmail.com) wrote: > I believe most users would anticipate a CREATE TABLE statement that aligns > with the currently installed version- this is the practical solution for > the vast majority. Perhaps a bit more

Re: Adding SHOW CREATE TABLE

2023-05-12 Thread Nathaniel Sabanski
I believe most users would anticipate a CREATE TABLE statement that aligns with the currently installed version- this is the practical solution for the vast majority. In situations where a CREATE TABLE statement compatible with an older version of Postgres is required, users can opt for an

Re: Adding SHOW CREATE TABLE

2023-05-12 Thread Stephen Frost
Greetings, * Nathaniel Sabanski (sabansk...@gmail.com) wrote: > HN had a thread regarding the challenges faced by new users during the > adoption of Postgres in 2023. > > One particular issue that garnered significant votes was the lack of a > "SHOW CREATE TABLE" command, and seems like it would

Adding SHOW CREATE TABLE

2023-05-12 Thread Nathaniel Sabanski
HN had a thread regarding the challenges faced by new users during the adoption of Postgres in 2023. One particular issue that garnered significant votes was the lack of a "SHOW CREATE TABLE" command, and seems like it would be an easy one to implement: