postgresql create table using select