3

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?

8

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.