微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

PostgreSQL – 在授予特权时,关系不存在错误

我用sudo进入了postgres控制台并做了这个:
create user uu with password 'uu';    
create database u_db owner uu;   
grant all privileges on u_db to uu;

错误:关系u_db不存在.

您必须在此处使用关键字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授予额外的权利.

原文地址:https://www.jb51.cc/postgresql/191985.html

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐