gpt4 book ai didi

python - pg_dump : too many command-line arguments (first is "--host=localhost")

转载 作者:行者123 更新时间:2023-12-03 09:02:12 24 4
gpt4 key购买 nike

我已经解决了一些类似的问题,但没有找到任何可行的解决方案。

我尝试在我的 Django 项目中使用 djang-dbbackup 模块。我运行 $ python manage.py dbbackup 并收到此错误:

CommandConnectorError: Error running:  pg_dump last_cosmetics --host=localhost --username=postgres --no-password --clean 
b'pg_dump: too many command-line arguments (first is "--host=localhost")\r\nTry "pg_dump --help" for more information.\r\n'

我还尝试在 Windows cmd 上运行它。

pg_dump last_cosmetics --host=localhost --username=postgres --no-password --clean

但我仍然遇到同样的错误。

最佳答案

您可以在 here 中检查语法.

数据库名称应该是所有选项之后的最后一个参数。

所以在你的情况下使用:

pg_dump --host=localhost --username=postgres --no-password --clean last_cosmetics

关于python - pg_dump : too many command-line arguments (first is "--host=localhost"),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49389166/

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