我有自己的带有postgres dmp文件的计算机,我想在网络中的远程虚拟机(例如ip为192.168.0.190且postgres端口为5432)上还原该文件。是否可以使用pg_restore还原此转储而不将转储复制到远程计算机?因为转储的大小约为12GB,而虚拟机上的磁盘空间为20GB。 谢谢
I've got my own machine with postgres dmp file, which I want to restore on the remote virtual machine (e.g. ip is 192.168.0.190 and postgres port is 5432) in my network. Is it possible to restore this dump using pg_restore without copying dump to remote machine? Because the size of dump about 12GB and the disk space on the virtual machine is 20GB. Thanks
推荐答案您可以通过网络运行还原,而无需将转储复制到远程主机。
You can run a restore over the network without copying the dump to the remote host.
只需使用 -h< hostname> 和 -p< port> (也可能是 -U< username> 来认证为其他用户)您获得转储文件的主机,例如:
Just invoke pg_restore with -h <hostname> and -p <port> (and probably -U <username> to authenticate as different user) on the host you got the dump file, for example:
pg_restore -h 192.168.0.190 -p 5432 -d databasename -U myuser mydump.dump参考文献:
- pg_restore文档
- pg_restore documentation
更多推荐
在远程计算机上还原转储
发布评论