If you want to merging data from older database to new database in PostgreSQL or want to merge data from other database(db1) to another database(db2), follow these below steps:
- from db1, export all the necessary tables to csv using:
copy (select * from table_name) to E'C:\\Users\\dinesh\\Documents\\table_name.csv' csv Header;
- Now in db2, import using:
COPY table_name FROM E'C:\\Users\\dinesh\\Documents\\table_name.csv' WITH Delimiter ',' Null '' csv;
0 Comment(s)