Answers for "postgres how to copy table from one database to another"

SQL
1

postgres copy table from one schema to another

create table schema2.the_table (like schema1.the_table including all);
insert into schema2.the_table
select * 
from schema1.the_table;
Posted by: Guest on June-15-2020
0

copy data from one postgres container to another

docker exec -t your-db-container pg_dumpall -c -U postgres > dump_`date +%d-%m-%Y"_"%H_%M_%S`.sql
cat your_dump.sql | docker exec -i your-db-container psql -U postgres
Posted by: Guest on June-29-2020

Code answers related to "postgres how to copy table from one database to another"

Code answers related to "SQL"

Browse Popular Code Answers by Language