I want to save a copy of specific table with it's data. All I care is the structure and data. I don't want to copy the keys nor constrains.
I read this answer Copy table structure into new table but it's not quite what I need.
How it can be done?
Using the \copy command to import data to a table on a PostgreSQL DB instance. The PostgreSQL \copy command is a meta-command available from the psql interactive client tool. You can use \copy to import data into a table on your RDS for PostgreSQL DB instance.
If you COPY data into a table already containing data, the new data will be appended. If you COPY TO a file already containing data, the existing data will be overwritten.
You are probably looking for CREATE TABLE AS SELECT, e.g.:
CREATE TABLE copy_table AS SELECT * FROM original_table;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With