Is there a way to copy the structure of a table into a new table, without data, including all keys and constraints?
How about
CREATE TABLE sample_table_copy AS (SELECT * FROM sample_table WHERE 1 = 2)
postgresql.org answer