Answer the question
In order to leave comments, you need to log in
Postgres, how to create a new table that fully matches another table?
That is, there is a table of cities - with data, indexes, restrictions.
I want to create a new table that fully corresponds to the table of cities. How to do it?
I tried to do it this way: CREATE TABLE new_city AS (SELECT * FROM city);
In the new table there were only data.
Answer the question
In order to leave comments, you need to log in
create table new_city (like city including all);
insert into new_city select * from city;
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question