doc/user/content/sql/show-create-table.md
SHOW CREATE TABLE returns the SQL used to create the table.
SHOW [REDACTED] CREATE TABLE <table_name>;
{{< yaml-table data="show_create_redacted_option" >}}
For available table names, see SHOW TABLES.
CREATE TABLE t (a int, b text NOT NULL);
SHOW CREATE TABLE t;
name | create_sql
----------------------+-----------------------------------------------------------------------------------------------------
materialize.public.t | CREATE TABLE "materialize"."public"."t" ("a" "pg_catalog"."int4", "b" "pg_catalog"."text" NOT NULL)
The privileges required to execute this statement are:
{{% include-headless "/headless/sql-command-privileges/show-create-table" %}}