简体   繁体   English

如何在Windows命令行上使用pg_restore?

[英]How to use pg_restore on Windows Command Line?

I have downloaded a PG database backup from my Heroku App, it's in my repository folder as latest.dump 我已经从我的Heroku App下载了PG数据库备份,该备份在我的存储库文件夹中为last.dump。

I have installed postgres locally, but I can't use pg_restore on the windows command line, I need to run this command: pg_restore --verbose --clean --no-acl --no-owner -j 2 -h localhost -d DBNAME latest.dump 我已经在本地安装了postgres,但是我无法在Windows命令行上使用pg_restore,我需要运行以下命令: pg_restore --verbose --clean --no-acl --no-owner -j 2 -h localhost -d DBNAME latest.dump

But the command is not found! 但是找不到命令!

Since you're on windows, you probably just don't have pg_restore on your path. 由于您在Windows上,因此路径上可能没有pg_restore。 You can find pg_restore in the bin of your postgresql installation eg c:\\program files\\PostgreSQL\\9.5\\bin. 您可以在PostgreSQL安装的bin中找到pg_restore,例如c:\\ program files \\ PostgreSQL \\ 9.5 \\ bin。

You can navigate to the correct location or simply add the location to your path so you won't need to navigate always. 您可以导航到正确的位置,也可以将位置添加到路径中,这样就不必始终导航。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 从 python 调用 pg_restore - Call pg_restore from python 在转储文件上使用pg_restore - Using pg_restore on dump file 有没有一种方法可以使用pg_restore自动解压缩? - Is there a way to unzip automatically with pg_restore? 如何更改列的顺序,使其不会破坏 pg_restore 的导入 - How to I change the order of my columns so it doesn't break an import with pg_restore Python function 到 pg_restore 谷歌云 SQL 数据库 - Python function to pg_restore a Google Cloud SQL database 不同服务器之间的 pg_dump 和 pg_restore 具有对要转储的数据的选择标准 - pg_dump and pg_restore between different servers with a selection criteria on the data to be dumped 使用 python 模块子进程的 pg_dump & pg_restore 密码 - pg_dump & pg_restore password using python module subprocess 如何使用命令行在 windows 上使用 openvpn? - How can one use the command-line to use openvpn on windows? pg_restore:错误:尝试将 postgres 数据库导入到 heroku 时搜索存档时无法识别的数据块类型 (0) - pg_restore: error: unrecognized data block type (0) while searching archive while trying to import postgres database to heroku 如何在 Windows 命令行中使用 python 'input' function ? - How to use python 'input' function in Windows command line?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM