非Linux postgresql用户可以创建数据库吗?

时间:2014-04-29 15:42:22

标签: postgresql

postgres创建了一个postgresql用户foo

$ sudo -u postgres createuser -d -P foo
Enter password for new role: foo
Enter it again: foo

可以foo创建数据库吗,让我们说foo

1 个答案:

答案 0 :(得分:2)

http://www.postgresql.org/docs/current/static/app-createuser.html

  

-d   --createdb   将允许新用户创建数据库。

因为你使用了-d参数,用户foo应该拥有create databases这样的权限:

createdb -h localhost -U foo foos_db