gpt4 book ai didi

postgresql - 如何将数据从 Windows 上的 postgres 移动到 Linux (Ubuntu) 上的 postgres

转载 作者:行者123 更新时间:2023-11-29 14:16:34 25 4
gpt4 key购买 nike

我在装有 Windows 操作系统的机器上安装了 Postgres 数据库,我也有装有 Linux (Ubuntu) 的虚拟机。我需要将数据从 Windows 移动到 Linux。提前致谢!

最佳答案

您可以使用下面的查询将数据库从一台服务器恢复到另一台

pg_dump -C -h SourceServer -U SourceUser  SourceDB | psql -h TargetHost -U TargetUser  TargetDB

可以从 pgpass.conf 使用密码

关于postgresql - 如何将数据从 Windows 上的 postgres 移动到 Linux (Ubuntu) 上的 postgres,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46691027/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com