【发布时间】:2019-05-09 09:37:12
【问题描述】:
我正在学习书中的教程:
梅勒,安东尼奥。 Django 2 示例:从头开始构建功能强大且可靠的 Python Web 应用程序(Kindle 位置 1917-1918)。 包出版。 Kindle 版。
我在这部分:
- 为您的博客添加全文搜索
- 安装 PostgreSQL
我在 Windows 10 上,我安装了 Postgres 很好。说明说要输入 postgres shell:
su postgres
createuser -dP blog
我想我正在尝试创建一个名为 blog 的用户,该用户将拥有密码并被允许创建数据库?
当我这样做时,我得到:
Server [localhost]: su postgres
Database [postgres]: createuser -dP blog
Port [5432]:
Username [postgres]:
psql: warning: extra command-line argument "postgres" ignored
psql: warning: extra command-line argument "-d" ignored
psql: warning: extra command-line argument "createuser" ignored
psql: warning: extra command-line argument "-dP" ignored
psql: warning: extra command-line argument "blog" ignored
psql: warning: extra command-line argument "-p" ignored
psql: warning: extra command-line argument "5432" ignored
psql: could not translate host name "su" to address: Unknown host
Press any key to continue . . .
我不确定该怎么做或到底发生了什么?指令很不清楚
【问题讨论】:
-
这本书应该可以在任何操作系统上运行,我认为这只是作者的疏忽——它只是说要打开外壳。我可以使用 pgAdmin,并且我有一台使用 postgres 的 Mac,但我想知道 windows psql shell 发生了什么?
标签: django postgresql windows-10 psql