更新时间: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