Postgres CLI查询未执行

时间:2014-09-16 15:21:56

标签: sql linux postgresql terminal

我已经在本教程的帮助下在我的ubuntu操作系统上安装了postgresql Tutorial

我按照前几步操作,我需要创建ROLES,但我的查询没有执行,甚至没有任何选择查询,它只是移动到下一行而没有任何错误。

在尝试创建新角色时,这似乎对我有用

createuser test_user

但在创建用户后,它并没有提示我这些选项

Shall the new role be a superuser? (y/n) n
Shall the new role be allowed to create databases? (y/n) n
Shall the new role be allowed to create more new roles? (y/n) n

我无法更改这些用户的权限,因为我的查询没有被执行而不会出现任何错误。

1 个答案:

答案 0 :(得分:1)

  

但在用户访问后,它并没有提示我这些选项   创建

最近的PostgreSQL客户端是正常的。添加--interactive选项以使用教程使用的旧版本等选项进行提示。

从联系手册:

  --interactive
       Prompt for the user name if none is specified on the command line, and also prompt for
       whichever of the options -d/-D, -r/-R, -s/-S is not specified on the command line. (This
       was the default behavior up to PostgreSQL 9.1.)

关于不执行的查询:

  

我的查询不执行,甚至没有任何选择查询,它   只需移动到下一行没有任何错误

你可能忘记用分号完成查询。或者,查询具有不平衡的简单或双引号,并且解释程序等待您关闭引用的部分。 如果您需要更多关于此问题的帮助,请使用psql上显示的内容的完全复制粘贴来修改您的问题。 psql中的提示显示了它所处的状态以及它正在等待的内容。

相关问题