SHOW CREATE TABLE

SHOW CREATE TABLE returns the SQL used to create the table.

Syntax

SHOW CREATE TABLE table_name
Field Use
table_name The table you want use. You can find available table names through SHOW TABLES.

Examples

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)

Privileges

The privileges required to execute this statement are:

  • USAGE privileges on the schema containing the table.
Back to top ↑