I want to copy huge datasets between two postgres servers. Specifically I want to:
- copy some columns (not all) from two tables in source db server, to a single table in destination db server.
- rename those columns in destination table (as datasets are copies) as destination column name isn't same as origin column name (maybe I should say insert values in some_column_name in destination table).
I understand postgres_fdw
cannot be used to achieve this task as it copies entire table to new one (not merging selected field to form a new table) and both origin and destination tables must be of matching column number.
My source db server is a remote I ssh, and the datasets to copy is about 5GB.
Any suggestion to achieve my task?