I am trying to copy a number of tables from one server to another using PostgreSQL as part of reorganising our data structure. I am pretty new to PostgreSQL so haven't much experience with it. Is there a simple way to do this?
1 Answer
Command-line dump straight into psql is the best bet
pg_dump -h host1 -t yourtable database1 | psql -d database2 -h host2
The line in the middle is a pipe, it takes the output from the first command and provides it as input to the second.