Is there a way to copy the structure of a table into a new table, without data, including all keys and constraints?
For a simple schema copy use the like clause.
CREATE TABLE new_table_name (LIKE old_table_name INCLUDING ALL);
2.1m questions
2.1m answers
60 comments
57.0k users