Just use a where clause that won't select any rows:
create table xyz_new as select * from xyz where 1=0;
Limitations
The following things will not be copied to the new table:
- sequences
- triggers
- indexes
- some constraints may not be copied
- materialized view logs
This also does not handle partitions
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…