I have to move several tables from one remote database to another in PostgreSQL.
From my understanding the only way of doing it is via the pg_dump.
pg_dump -h <source_db_host> -U <source_db_user> -d <source_db_name> -f database_dump.sql
psql -h <target_db_host> -U <target_db_user> -d <target_db_name> -f database_dump.sql
However, it fails as the schema in destination database is different from the one in source, so I receive the error message that particular schema is not exist in source db.
Is there anyway how to change the destination schema?
Is there any other easier option for transferring the datasets?