This snippet shows you how you can copy a whole table to another one. Useful if you are about to change data in a table and later need to compare it with EXCEPT.
Source code viewer
create table clone_of_my_table as (select * from my_table); -- Table/structure without any data create table clone_of_my_table as (select * from my_table) with no data;Programming Language: PostgreSQL