Thread: Pg_dump

Pg_dump

From
"Hunter, Ray"
Date:
<p><font color="#808080" face="Verdana" size="2">Question: </font><p><font color="#808080" face="Verdana" size="2">How
fastdoes pg_dump handle this scenario?</font> <font face="Times New Roman">pg_dump -h<i> host1</i><i> dbname</i> | psql
-h<i>host2</i><i> dbname</i></font><p><font color="#808080" face="Verdana" size="2">What is the difference between
doingthe above vs. doing rsync over a secure connections?</font><br /><br /><br /><br /><p><font color="#808080"
face="Verdana"size="2">Thank you,</font><p><b><font face="Verdana" size="2">Ray Hunter</font></b><br /><font
color="#808080"face="Verdana" size="2">Firmware Engineer</font><p><b><font face="Verdana" size="2">ENTERASYS
NETWORKS</font></b><p><fontcolor="#808080" face="Verdana" size="2">Internal:       53888</font><br /><font
color="#808080"face="Verdana" size="2">External:       801 887-9888</font><br /><font color="#808080" face="Verdana"
size="2">Email:</font>         <a href="mailto:rhunter@enterasys.com"><u><font color="#0000FF" face="Verdana"
size="2">rhunter@enterasys.com</font></u></a><br/><font color="#808080" face="Verdana" size="2">www:</font>           
<ahref="http://www.enterasys.com"><u><font color="#0000FF" face="Verdana" size="2">www.enterasys.com</font></u></a><br
/><br/> 

Re: Pg_dump

From
knut.suebert@web.de
Date:
Hunter, Ray schrieb:
>    Question:
> 
>    How fast does pg_dump handle this scenario? pg_dump -h host1 dbname | psql
>    -h host2 dbname

Depends on the speed of the network connection, I'd guess. Compression
seems to be involved by using the option "-Fc".

But I got no experience on this.

For security reasons, tunneling over ssh could be interesting.
>    What is the difference between doing the above vs. doing rsync over a
>    secure connections?

"rsync -e ssh -z" the dumped files? Than you got compressed security
(with some speed penalties for encryption, depending on the relation
between CPU power and network bandwidth). You have to involve remote
commands on the source host before for dumping and afterwards on the
target host to restore. If you got an older dump of the source on the
target before, that could speed up a *very* lot.

I don't know how perfect rsync is in finding very small differences in
very large data. But there are options to tune it's behavior.

If you think about "rsync /var/lib/postgres/data" of running
postmasters, that should give total trash on the target. Only an
option, if both postmasters are stopped before and all databases are
to be synced.

For me, it seems more efficent to login remotely on host1 or host2
before doing the "rsync" or "pg_dump | pgsql". It that case, the data
has to be transmitted one way host1->host2 only instead of two way
host1->host0->host2 (but that penalty could depend on the network's
configuration and maybe the programs do it better automatically).

Just my ideas about differences,
Knut Sübert