且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

端口5432被阻止时,来自远程服务器的pg_dump postgres数据库

更新时间:2023-02-02 20:18:05

您可以使用ssh连接到远程服务器,执行连接pg_dump调用,然后将输出发送回stdout

You can connect with ssh to your remote server, do with the connect the pg_dump call and send the output back to stdout of local machine.

ssh user@remote_machine "pg_dump -U dbuser -h localhost -C --column-inserts" \
 > backup_file_on_your_local_machine.sql