关联关系被拒绝 [英] Permission denied for relation

查看:230
本文介绍了关联关系被拒绝的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试运行简单的sql命令:

I tried to run simple sql command:

select * from site_adzone;

我收到了这个错误

ERROR:  permission denied for relation site_adzone

这里可能是什么问题?

我也尝试对其他表进行选择,并遇到相同的问题.我也尝试这样做:

I tried also to do select for other tables and got same issue. I also tried to do this:

GRANT ALL PRIVILEGES ON DATABASE jerry to tom;

但是我从控制台得到了这个回复

but I got this response from console

WARNING:  no privileges were granted for "jerry"

您知道什么地方可能出问题吗?

Do you have some idea what can be wrong?

推荐答案

数据库上的GRNT并不是您所需要的.直接在表上授予.

GRANT on the database is not what you need. Grant on the tables directly.

授予数据库特权通常用于授予或撤消连接特权.这样,您可以指定如果他们具有足够的其他权限,谁可以在数据库中执行操作.

Granting privileges on the database mostly is used to grant or revoke connect privileges. This allows you to specify who may do stuff in the database if they have sufficient other permissions.

您想要的是:

 GRANT ALL PRIVILEGES ON TABLE side_adzone TO jerry;

这将解决此问题.

这篇关于关联关系被拒绝的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆