用于导入/导出数据/ddl 的 Postgres 命令行工具
对于 Postgres 是否有任何类型的命令行实用程序允许数据库“转储到文件”并允许导入相同的数据库转储?
我知道这可以通过 PGAdmin 完成,但我需要能够在 cmd 行上执行此操作。
For Postgres is there any sort of command line utilities that allow a database to be "dumped to a file" and that allow that same database dump to be imported?
I know this can be done through PGAdmin, but I need to be able to do this on the cmd line.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
是的,看看
pg_dump
和pg_restore
http://www.postgresql.org/docs/current/static/app-pgdump.html
http://www.postgresql.org/docs/current/static/app-pgrestore.html
Yeah, take a look into
pg_dump
andpg_restore
http://www.postgresql.org/docs/current/static/app-pgdump.html
http://www.postgresql.org/docs/current/static/app-pgrestore.html
正确的,执行此操作的方法是 pg_dump、pg_dumpall 和 pg_restore 命令。事实上,我认为 pg_admin 实际上调用了这些命令本身。它实际上没有内置备份/恢复功能,而只是一个包装器。
Correct, the way to do this is the pg_dump, pg_dumpall and pg_restore commands. In fact, I think pg_admin actually calls those commands itself. It doesn't actually have backup/restore built in but is just a wrapper.