When we do:
create table big2 as select * from big1;
Are the indexes and constraints also copied over to the new table?
When we do:
create table big2 as select * from big1;
Are the indexes and constraints also copied over to the new table?
Just for info, there is a simple way to remember indices to recreate them after deleting source table:
Only NOT NULL constraints are copied. See FAQ.
You can do
CREATE TABLE big2 (bigid PRIMARY KEY) AS SELECT * FROM big1
tp create a primary key, but yes, for other indexes you'll want to copy and run the index creation scripts.