2014-04-24 83 views
6

我进入Postgres的控制台使用sudo,这样做,当关系犯规存在错误。PostgreSQL的授予特权时

+0

'授予DATABASE u_db所有权限给uu;'([更多信息](http://www.postgresql.org/docs/current/static/sql-grant.html)) –

回答

12

您必须在此处使用关键字DATABASE进行授予。所以我发布你psql的输出:

postgres=# create user uu with password 'uu'; 
CREATE ROLE 
postgres=# create database u_db owner uu; 
CREATE DATABASE 
postgres=# grant all privileges on u_db to uu; 
FEHLER: Relation »u_db« existiert nicht 
postgres=# grant all privileges on database u_db to uu; 
GRANT 

不过。恕我直言,通过数据库的所有者设置,你不需要授予用户uu的额外权利。