Re: Adding SHOW CREATE TABLE

From: Nathaniel Sabanski <sabanski(dot)n(at)gmail(dot)com>
To:
Cc: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: Adding SHOW CREATE TABLE
Date: 2023-05-12 20:04:00
Message-ID: CAFEN2wxg0Vtj1gvk6Ms0L2CAutbycyxHZPiZSpW7eLsBc6VGnA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

> 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 drastically cut down the implementation time and
complexity to support Postgres. I am one of the devs of Piccolo ORM (Python
lib supporting Postgres) and we have a lot of code dedicated to
re-generating the CREATE TABLE statements (creation, during migrations,
etc) that could be done better by Postgres itself.

Ecosystem cohesion: SHOW CREATE TABLE has already been implemented in
CockroachDB, a popular Postgres derivative.

Moving to Postgres: It would help ease migrations for developers wanting to
move from MySQL / Percona / MariaDB to Postgres. Also it's a nice developer
experience to see how Postgres generates X table without extra tooling.

The intention of SHOW CREATE TABLE is not to replace the existing suite of
\d in psql but rather to be a developer friendly complement within SQL
itself.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Stephen Frost 2023-05-12 20:14:27 Re: Adding SHOW CREATE TABLE
Previous Message Adrian Klaver 2023-05-12 19:20:58 Re: PG_Cron - Error Message Connection failed

Browse pgsql-hackers by date

  From Date Subject
Next Message Stephen Frost 2023-05-12 20:14:27 Re: Adding SHOW CREATE TABLE
Previous Message Andrew Dunstan 2023-05-12 19:57:06 Re: Should CSV parsing be stricter about mid-field quotes?