Craig James <craig_james@emolecules.com> wrote:
> If you have a slow network, then run pg_dump on the machine where
> the database lives and use compression (--format=c) and restore
> using pg_restore. It will cut WAY down on the amount of data that
> has to move across the net.
If you don't mind dancing around a bit you can ssh from the target
to the source, run pg_dump piped to gzip there, gunzip the stream on
the target side, and still pipe it into psql without having to go
through the disk write/read cycle that --format=c requires. Because
of the pain of getting all the quoting right when trying that as a
one-line bash command, I generally create a short script on the
source to do the dump and gzip. The only other pain point is the
remote password. .pgpass solves that.
-Kevin